Monthly Archives: May 2018

WMI and CIM accelerators

In PowerShell an accelerator is a shortcut to a .NET type. The WMI accelerators have been around since PowerShell v1. The WMI accelerators were heavily used in v1 fill some of the gaps in cmdlet coverage. The CIM accelerators appeared … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | Leave a comment

PowerShell parameter sets

PowerShell parameter sets allow you to control which parameters can be used together. If a parameter isn’t in the parameter set you’re trying to use you’ll get an error message. PS> Get-VM -Name XYZ -id (New-Guid) Get-VM : Parameter set … Continue reading

Posted in Powershell | Leave a comment

PowerShell version

Discovering the PowerShell version you’re using can be an interesting task. The automatic variable $PSVersionTable was introduced in PowerShell v2.  On my Windows 10 version 1803 machine for Windows PowerShell I get PS> $PSVersionTable Name                           Value —-                           —– PSVersion                      5.1.17134.48 … Continue reading

Posted in PowerShell v5, PowerShell v6 | Leave a comment

Format Data

PowerShell will format the output of objects that it knows about.  For instance Get-Process shows different sets of properties depending on whether  you choose a table or list view. The format data is stored in files named *.format.ps1xml. In Windows … Continue reading

Posted in PowerShell v6 | Leave a comment

where –not

PowerShell v6.1 preview 2 has added the where –not option. The option adds another parameter to the syntax where-object <property name> <operator like parameter> <value> Couple of examples of using the syntax Get-Process | where CPU -gt 12 Get-Service | … Continue reading

Posted in PowerShell v6 | 1 Comment

Calculating standard deviation

Calculating a standard deviation isn’t a difficult exercise but PowerShell v6.1 offers an easier method. In Windows PowerShell v5.1 and PowerShell v6.0 the Measure-Object cmdlet has this syntax PS> Get-Command Measure-Object -Syntax Measure-Object [[-Property] <string[]>] [-InputObject <psobject>] [-Sum] [-Average] [-Maximum] … Continue reading

Posted in PowerShell v6 | Leave a comment

PowerShell problem reporting

There seems to be a lot of confusion about PowerShell problem reporting. The difference between Windows PowerShell (the one you find pre-installed on Windows machines) current version v5.1 and PowerShell (the open source project) current version v6.0 isn’t really understood … Continue reading

Posted in Powershell | 1 Comment