Monthly Archives: January 2018

Clear-RecycleBin

Every so often I find a new cmdlet in PowerShell. This was the case with Clear-RecycleBin that I’ve just found. It appears to have been introduced with PowerShell 5.0 BUT isn’t available in PowerShell 6.0 With pretty simple syntax PS> … Continue reading

Posted in PowerShell v5 | 1 Comment

Documentation can be wrong!

We rely on vendor documentation to help us solve problems. Documentation is produced by people and people make mistakes so Documentation can be wrong! As an example: The CIM class Win32_OperatingSystem has a Description property. According to the documentation the … Continue reading

Posted in Powershell | 2 Comments

PowerShell sleep

PowerShell use tends to be very interactive. You run a command at the console and get some results. You run a script and get some results. How do you make PowerShell sleep? There’s a few ways you can make PowerShell … Continue reading

Posted in Powershell | Leave a comment

PowerShell –f string

A PowerShell –f string is used to format the data inside a string. –f is usually referred to as the format operator. The operation of the format operator is best explained by examples. At its simplest you create fields in … Continue reading

Posted in Powershell | Leave a comment

DSC update

The PowerShell team have posted an update on what’s happening with DSC. https://blogs.msdn.microsoft.com/powershell/2018/01/26/dsc-planning-update-january-2018/ The interesting thing is the decoupling of the Local Configuration Manager from Windows. A new LCM that can use resources written in multiple languages sounds good – … Continue reading

Posted in DSC, Powershell | Leave a comment

PowerShell v6.0.1

PowerShell v6.0.1 is available from https://github.com/PowerShell/PowerShell/releases This release upgrades PowerShell to use .NET core v2.0.5 which addresses a couple of security vulnerabilities. The release also addresses upgrade issues on some Linux distributions due to version numbers being misunderstood. Also available … Continue reading

Posted in PowerShell v6 | Leave a comment

Iron Scripter prequels

One of the new things for Summit 2018 is the iron Scripter competition on the last afternoon. As a warm up for the competition we’re running a number of Iron Scripter prequels. A puzzle will be published every week – … Continue reading

Posted in Powershell, Scripting Games, Summit | Leave a comment

PowerShell v6 GA and beyond

PowerShell v6 achieved General Availability on 10 January 2018. https://blogs.msdn.microsoft.com/powershell/2018/01/10/powershell-core-6-0-generally-available-ga-and-supported/ Why do these things always happen when I’m in a plane over the Atlantic? GA is a tremendous milestone but its not the end by any means. Work has already … Continue reading

Posted in PowerShell v6 | Leave a comment

Just the date

Way back in this post https://richardspowershellblog.wordpress.com/2008/03/27/start-and-end-of-week/ I showed how to find the start of the week. I recently had a question about how to restrict the display to just the date. PowerShell uses the .NET datetime class for working with … Continue reading

Posted in Powershell | Leave a comment

Relevance of Scripts

I had a sudden thought today about the relevance of scripts – PowerShell Scripts –  today. PowerShell v6 can’t run some of the modules that we’ve come to rely on – for instance the AD cmdlets. The Windows Compatibility Pack … Continue reading

Posted in Books, Powershell | Leave a comment