Finding Operating System Version

by Oct 29, 2015

One of the easiest ways of getting your operating system version is this one line of code:

 
PS> [Environment]::OSVersion

Platform ServicePack        Version             VersionString         
-------- -----------        -------             -------------         
 Win32NT Service Pack 1     6.1.7601.65536      Microsoft Windows N...
 

The type "Environment" provides information about many aspects of your computer; for example, the number of processor cores:

 
PS> [Environment]::ProcessorCount
4
 

To see what the type can do for you, in the PowerShell ISE, type:

[Environment]:: 

Once you typed the second ***, IntelliSense will open a menu with all the static properties and methods available with this type.

Twitter This Tip! ReTweet this Tip!