Get Version of PowerShell

article #1201, updated 1840 days ago

My current favorite way:

[string]$PSVersionTable.PSVersion.Major + '.' + [string]$PSVersionTable.PSVersion.Minor

If it’s 1.0, you’ll get an error, otherwise you will have what you need.

Categories: