There should be no difference required in the PowerShell check for the different operating systems, there shouldn’t be any issues running the installer on Windows 2012R2.
The reason the command gives that output when you add Write-Output to the start is that it treats the command as a string and prints it literally, rather than actually running the command.
This means that PowerShell.exe isn’t actually called from within the window, what’s actually happening is PowerShell is printing “powershell.exe -NonInteractive -NoProfile -Command” as a string, then printing out “write-Output”, then the variable object $PSVersionTable.PSVersion.
With this interaction being how it is, I expect you would see the same result from this:
Notice how the above variable is encapsulated in quotes, this will cause the variable object to be printed literally: ‘System.Collections.Hashtable.PSVersion’.
If you type the variable without quotes in the command line, that is when you would get the version table.
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 592
Could you try the above and see if you experience the same behaviour?
The issues seem to appear when calling PowerShell from the command line as if the output is being redirected.