June 2nd, 2013

PowerTip: Determine PowerShell Version

Doctor Scripto
Scripter

Summary: Easily determine the version of Windows PowerShell that is installed.

Hey, Scripting Guy! Question How can I determine what version of Windows PowerShell is installed on my computer?

Hey, Scripting Guy! Answer Use the $psversiontable automatic variable, which is available in Windows PowerShell 2.0 and Windows PowerShell 3.0. 
          (If nothing comes back, you are running Windows PowerShell 1.0.)

PS C:> $PSVersionTable

 

Name                           Value

—-                           —–

PSVersion                      3.0

WSManStackVersion              3.0

SerializationVersion           1.1.0.1

CLRVersion                     4.0.30319.18046

BuildVersion                   6.2.9200.16434

PSCompatibleVersions           {1.0, 2.0, 3.0}

PSRemotingProtocolVersion      2.2

 

To return only the version, access the PSVersion property:

PS C:> $PSVersionTable.PSVersion

 

Major  Minor  Build  Revision

—–  —–  —–  ——–

3      0      -1     -1

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.