8

http://msdn.microsoft.com/en-us/library/ff637750.aspx claims

Windows PowerShell 2.0 needs to be installed on Windows Server 2008 and Windows Vista only. It is already installed on Windows Server 2008 R2 and Windows 7.

However, powershell.exe lives here %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe. That doesn't seem like it would be PowerShell 2.0. The file version of powershell.exe is 6.1.7600.16385 so that doesn't help much either.

How do I know for sure if I have Window PowerShell 2.0 installed and if I don't, where is a download link for Windows 7?

Breakthrough
  • 34,847
kenwarner
  • 2,457

4 Answers4

12

You can also use $PSVersionTable

PS > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      2.0
PSCompatibleVersions           {1.0, 2.0}
BuildVersion                   6.1.7600.16385
PSRemotingProtocolVersion      2.1
WSManStackVersion              2.0
CLRVersion                     4.0.30319.225
SerializationVersion           1.1.0.1

This var exists only in PowerShell V2.0 and gives th CLR version you use. Normal result is:

PS > $PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.4959
BuildVersion                   6.1.7600.16385
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1
JPBlanc
  • 220
10

You don't need to dig it out of the registry keys. Just run get-host and check the version.

4

The location of the PowerShell executable and supporting files wasn't changed for V2, nor was the .ps1 script extension because V2 is fully backward compatible—it replaces V1 rather than needing some side by side mechanism.

Richard
  • 9,172
0

Figured it out

Link

To check whether version 1.0 or 2.0 of PowerShell is installed, check for the following value in the registry:
Key Location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine
Value Name: PowerShellVersion
Value Type: REG_SZ
Value Data: <1.0 | 2.0>

Glorfindel
  • 4,158
kenwarner
  • 2,457