Windows Management Framework (PowerShell) 4.0 is now available - ensure you already have .NET 4.5
Update 30/10/2013: There’s an updated post on the PowerShell Team Blog which now describes this situation with .NET 4.5 as a pre-requisite in more detail.
-———————————————————————————————-
PowerShell 4.0 which shipped as part of Windows Server 2012 R2 and Windows 8.1 is now available for down-level Windows versions via the downloadable Windows Management Framework 4.0.
WMF 4.0 contains updated versions of the following features:
Windows PowerShell Windows PowerShell Integrated Scripting Environment (ISE) Windows PowerShell Web Services (Management OData IIS Extension) Windows Remote Management (WinRM) Windows Management Infrastructure (WMI)
Additionally, we have added a new and exciting Windows PowerShell feature which is available in WMF 4.0: Windows PowerShell Desired State Configuration (DSC)
To use this updated management infrastructure to manage Windows 7 SP1, Windows Embedded 7, Windows Server 2008 R2 SP1, and Windows Server 2012, WMF 4.0 must be installed on computers that are running the previously-released operating systems.
For this Release, WMF 4.0 installs only on the following operating systems:
Note that Windows 8 is not listed and you are required to take the free upgrade to Windows 8.1 to get PowerShell 4.0.
One important requirement that is worth taking particular notice of is that .NET Framework 4.5 is a pre-requisite. While you may have installed this on your Windows 7 machine, it maybe not that likely that you have installed it on your server installations.
While this information is in the release notes, there is nothing in the installation that warns you of this requirement and an installation attempt without it results in (IMHO) a slightly bizarre outcome.
In this example I installed WMF 4.0 on a Windows Server 2008 R2 system with the WMF 2.0 / PowerShell 2.0 combination that ships as part of the OS.
The OS currently contains .NET Framework 3.5.
Tip: You can quickly find your latest .NET version with the following one-liner
<br /><br />&nbsp;<br /><br />Get-ChildItem 'HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP' -Recurse | Get-ItemProperty -name Version -EA 0 | Where-Object { $\_.PSChildName -match '^(?!S)\\p{L}'} | Sort-Object version -Descending | Select-Object -ExpandProperty Version -First 1<br /><br />
Having downloaded the correct WMF 4.0 version for Windows Server 2008 R2 I’ve started the installation:
Once the installation is complete, I check the version of PowerShell and discover that it is still 2.0.
<br /><br />$psversiontable<br /><br />
So nothing much seems to have changed! If you look carefully in the release notes though, installing without .NET Framework 4.5, results in two QFE hotfixes being installed.
Note: When you run the WMF 4.0 installation package, the following updates are installed first:
- KB 2823180, which is the equivalent of the Windows Management Framework 3.0 Update. This update is not removed if you uninstall WMF 4.0.
- KB 2872047 if WMF 3.0 is already installed on the computer.
- KB 2872035 if WMF 3.0 is not already installed on the computer.
Examining these hotfixes we can see two hotfixes have been installed:
(Confusingly, one of these KB2809215, is actually the KB2823180 mentioned in the release notes.)
If we attempt to install WMF 4.0 again we are told that it already has been installed:
So, let’s see what happens if we install the .NET Framework 4.5 pre-requisite:
Test the install:
Now try the install again
After reboot, we can confirm we now have PowerShell 4.0.
Got a headache yet? The crux of the story is make sure you have .NET Framework 4.5 before installing WMF 4.0 :-)