I was using the Get-LatestWMF5 function in the ISE on a Windows 2012 R2 (PowerShell version 4.0 by default) and it downloaded the wrong file 😦
I was using the [system.environment] .Net class to get the version of the Operating System.
It works fine in the console but not in the ISE.
As you can see, it’s reported as 6.2 which means Windows 8/2012 although I’m on Windows 2012 R2.
There’s actually a change introduced the API that controls this behavior.
It’s documented on this page: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx
Windows PowerShell MVP Dave Wyatt provided this link. Thx Dave 🙂
I propose to replace the code that uses the
[environment]::OSVersion.Version
[Version]$((Get-CimInstance Win32_OperatingSystem).Version)
Pingback: Dew Drop – May 27, 2015 (#2022) | Morning Dew