header image

PowerShell versions

Posted by: | April 15, 2014 | No Comment |

I’ve been using the CIM cmdlets for a number of posts recently and had a comment that a reader got a message that Get-CimInstance didn’t exist on their Windows 7 machine. 

Windows 7 ships with PowerShell 2.0; Windows 8 with PowerShell 3.0 and Windows 8.1 with PowerShell 4.0.

You need PowerShell 3.0 or 4.0 to have the CIM cmdlets.

You can install PowerShell 3.0 or 4.0 on Windows 7.  You need to go to the Microsoft  download site,  download and install the appropriate version of Windows Management Framework (WMF 3 contains PowerShell 3.0 and WMF 4 contains PowerShell 4.0).

You can tell which version of PowerShell you are running by looking in the $psversiontable automatic variable:

£> $psversiontable

Name                           Value
—-                           —–
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34014
BuildVersion                   6.3.9600.16394
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

under: PowerShell V3, PowerShell v4