Detect Version of Windows Management Framework – Methods

windows

Windows 7 and Windows 2008 R2 potentially can have WMF 2, WMF 3, or WMF 4 installed. Windows 2012 could have WMF3 or 4, and 2012 R2 has WMF 4.

I am looking for a method to find which version is installed. Hopefully this can be found via WMI, so I can use it within both Group Policy filters, and as a check within Powershell scripts I am planning on building that require functionality only available if WMF 3 or 4.

I must be asking the question the wrong way because I am not finding answers on Google.

Best Answer

If you are looking for a way to make sure you can run a GPO or PS script against a computer, I think you need to first determine if Powershell is even installed and which version it is. This can be done via the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine for ver 1 or 2, and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine for ver 3 or 4...under the PowerShellVersion value. Is that what you are after?

The Powershell variable: $PSVersionTable.PSVersion holds info regarding the WMF as well.