Category Archives: PowerShell v6

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 v6.1 Range Operator

The PowerShell v6.1 Rang Operator has been enhanced to deal with letters as well as numbers. The range operator has always been available in PowerShell. It can be used to generate a range of integers for example: PS>  (1..10) -join … Continue reading

Posted in PowerShell v6 | Leave a comment

Installing PowerShell v6.1 preview 2

The MSI for installing PowerShell v6.1 preview 2 has a screen for optional actions: Add PowerShell to Path environment variable Register Windows Event Logging Manifest Enable PowerShell remoting Add ‘open here’ context menus to Explorer The 6.1 preview installs side … Continue reading

Posted in PowerShell v6 | 1 Comment

PowerShell v6.1 preview 2

PowerShell v6.1 preview 2 is now available for download from https://github.com/PowerShell/PowerShell/releases The breaking changes shouldn’t affect your code as they’re for telemetry and installation Test-Connection is now available in v6 Export-FormatData will pretty print the XML rather than just giving … Continue reading

Posted in PowerShell v6 | Leave a comment