PowerShell for Windows Admins

Jan 31 2017   11:22AM GMT

Powershell versions

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
Powershell

There are two common questions around PowerShell versions.

Firstly, what version of PowerShell am I running?

The easiest way to answer this is to open a PowerShell console and use the built in $PSVersionTable variable

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.15019.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15019.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

$PSVersionTable is a hash table so the order of the results may be different for you

The data above is from the latest Windows 10 Insider Preview build (at the time of writing)

if you have Windows 10 with the Anniversary update you’ll see something like this

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

The PSVersion, BuildVersion and CLRVersion (>NET version) are slightly different. Note that you’ll get the same results in the PowerShell console or ISE.

If you’ve not looked at $PSVersionTable – the Edition entry may be new. That will read desktop for PowerShell 5.1 that is installed on full Windows. If you look at $PSVersionTable on Nano server you’ll see the Edition is Core. You’ll also see the Edition set to core on the PowerShell 6.0 alpha editions for Linux etc.

The other place that versions come into play are the extensions applied to powershell scripts, modules and module manifests. These are .ps1, .psm1, .psd1 respectively. Back in the days of PowerShell 1.0 there was a suggestion that future versions of PowerShell may utilise .ps2, .ps3 etc. This never came about and its probable that .p*1 extensions will keep being used.

Hope this helps clear any confusion on PowerShell versions

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: