How do I find which Windows version I’m using?
I’m using PowerShell 2.0 and tried:
PS C:\> ver
The term 'ver' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify tha
t the path is correct and try again.
At line:1 char:4
+ ver <<<<
+ CategoryInfo : ObjectNotFound: (ver:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
How do I do this?
Since you have access to the .NET library, you could access the
OSVersionproperty of theSystem.Environmentclass to get this information. For the version number, there is theVersionproperty.For example,
Details of Windows versions can be found here.