Meanwhile, there are five major versions of PowerShell around. Toss in the new minor versions such as PowerShell 5.1 on Windows 10 and Server 2016. Spice this with beta versions and prerelease editions, and serve with PowerShell on Linux or Nano Server. Whew.
It’s not easy to keep track, and understand which version you are using, where it came from, and what compatibility issues may exist. MVP colleague Jan Egil Ring maintains a cool module that you can download with a one-liner if you have PowerShell 5 or installed PowerShellGet from powershellgallery.com:
PS C:\> Install-Module -Name PSVersion -Scope CurrentUser
After consenting to a couple of questions, the module installed. It contains just two commands:
PS C:\> Get-Command -Module PSVersion CommandType Name Version Source ----------- ---- ------- ------ Function Get-PSVersion 1.6 PSVersion Function Update-PSVersionData 1.6 PSVersion
PSVersion is a community project to keep track with PowerShell release numbers, what they mean, and where they came from:
PS C:\> Get-PSVersion -ListVersion Name FriendlyName ApplicableOS ---- ------------ ------------ 5.1.14393.0 Windows PowerShell 5.1 Preview Windows 10 Anniversar... 5.1.14300.1000 Windows PowerShell 5.1 Preview Windows Server 2016 T... 5.0.10586.494 Windows PowerShell 5 RTM Windows 10 1511 + KB3... 5.0.10586.122 Windows PowerShell 5 RTM Windows 10 1511 + KB3... 5.0.10586.117 Windows PowerShell 5 RTM 1602 Windows Server 2012 R... 5.0.10586.63 Windows PowerShell 5 RTM Windows 10 1511 + KB3... 5.0.10586.51 Windows PowerShell 5 RTM 1512 Windows Server 2012 R... 5.0.10514.6 Windows PowerShell 5 Production Preview 1508 Windows Server 2012 R2 5.0.10018.0 Windows PowerShell 5 Preview 1502 Windows Server 2012 R2 5.0.9883.0 Windows PowerShell 5 Preview November 2014 Windows Server 2012 R... 4.0 Windows PowerShell 4 RTM Windows Server 2012 R... 3.0 Windows PowerShell 3 RTM Windows Server 2012, ... 2.0 Windows PowerShell 2 RTM Windows Server 2008 R... 1.0 Windows PowerShell 1 RTM Windows Server 2008, ...
And it is a way to get info about the PowerShell versions in your enterprise with friendly PowerShell version names:
PS C:\> Get-PSVersion PSComputerName PSVersion PSVersionFriendlyName -------------- --------- --------------------- CLIENT12 5.1.14393.0 Windows PowerShell 5.1 Preview