April 2, 2014 / by Alex Riedel / PowerShell Studio, PrimalScript, Software News, Windows PowerShell / 5 Comments

Microsoft Windows 8.1 breaks version API.

If we need to check what Windows version a PowerShell script run on, we usually use a statement like this:

Shell

So imagine our surprise when we saw what happens when you run this as a script in PrimalScript:

PrimalScript

Instead of reporting the actual Windows version, it appears as if we are running in Windows 8 instead of 8.1
To make sure we didn’t have a glitch in PrimalScript (and because we didn’t quite trust our eyes), we packaged the script as an executable and ran that.

 

Packaged

Same result, it reports the incorrect version number.

According to Microsoft this is intentional:

http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074(v=vs.85).aspx

Before you ask, we have no idea what could possibly possess Microsoft to break such a fundamental API call so that it reports an incorrect version.

As shown on the web page we linked to above, you have to tag your executable in a manifest as supporting Windows 8.1 in order to get a correct version number.

Custom manifest

In the packager settings you have to switch to a custom manifest and and specify the manifest file.

Settings

If you follow this patch and re-package the executable it will now report the correct version number.

With Manifest

Needless to say, we will update our default manifest and the packager to accommodate this latest “it’s not a bug, it’s a feature” play by Microsoft in the next service build.

RSS SAPIEN Info Center

Search the Archives

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Categories

Archives

BlogRoll

PowerShell Links

Information

Dashboard