There were several instances where I had to find details of the operating system using PowerShell. Here, I am providing several PowerShell snippets that return various details of the Operating System.

Name of the Operating System

PS C:\> (Get-WmiObject Win32_OperatingSystem).Name

Is Operating System 32-bit or 64-bit

PS C:\> (Get-WmiObject Win32_OperatingSystem).OSArchitecture

Name of the Machine

PS C:\> (Get-WmiObject Win32_OperatingSystem).CSName

There are many more properties of the Operating System that are exposed. To obtain more details, run the following

PS C:\> Get-WmiObject Win32_OperatingSystem | Get-Member

* Tested using PowerShell 2.0