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:

Operating System Service Pack Level Editions
Windows 7 Service Pack 1 All
Windows Server 2008 R2 Service Pack 1 All except IA64
Windows Server 2012   All except IA64
Windows Embedded 7   All

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.

WMF4_01

Tip: You can quickly find your latest .NET version with the following one-liner

<br /><br />&amp;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:

WMF4_02

WMF4_03

WMF4_04

Once the installation is complete, I check the version of PowerShell and discover that it is still 2.0.

<br /><br />$psversiontable<br /><br />

WMF4_05

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:

Examining these hotfixes we can see two hotfixes have been installed:

WMF4_06

(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:

WMF4_07

So, let’s see what happens if we install the .NET Framework 4.5 pre-requisite:

WMF4_08

WMF4_09

Test the install:

WMF4_10

Now try the install again

WMF4_11

WMF4_12

WMF4_13

After reboot, we can confirm we now have PowerShell 4.0.

WMF4_14

Got a headache yet? The crux of the story is make sure you have .NET Framework 4.5 before installing WMF 4.0 🙂

2 thoughts on “Windows Management Framework (PowerShell) 4.0 is now available – ensure you already have .NET 4.5

Comments are closed.