How to determine the current version of the operating system in MSBuild?

Is there a built-in or custom MSBuild task that returns the current version of the OS? Is there any binary code that I could call through the Exec task? Or is there another option?

Edit: Peter Lang suggested the following link: http://www.paraesthesia.com/archive/2009/07/06/getting-the-windows-os-version-in-msbuild.aspx

+3
source share
2 answers

You can try by searching the registry key as described in this post .

+2
source

You can use this PowerShell line:

Get-WMIObject Win32_OperatingSystem | select Version
+1
source

Source: https://habr.com/ru/post/1730908/


All Articles