How to Get Operating System Details with PowerShell

This article shows you how to get the details of your operating system with PowerShell. It shows how to get the operating system name, the OS Architecture, and the machine name. Here we go.

Step 1. Open PowerShell with elevated privileges.

Step 2. To check operating system name.

(Get-WMIObject win32_operatingsystem).name

Step 3. To check if the operating system is 32-bit or 64-bit.

(Get-WmiObject Win32_OperatingSystem).OSArchitecture

Step 4. To check machine name.

(Get-WmiObject Win32_OperatingSystem).CSName

Get Operating System Details with PowerShell

I have run the following commands on PowerShell version 5.1

3 thoughts on “How to Get Operating System Details with PowerShell”

    • $credential = Get-Credential
      Invoke-Command $addr -ScriptBlock {
      (Get-WMIObject win32_operatingsystem).caption
      } -Credential $credential

      Reply
  1. That’s way too slow.
    I would use something like:

    $server = get-adcomputer “MyServer”
    $OS = $(((gcim Win32_OperatingSystem -ComputerName $server.Name).Name).split(‘|’)[0])

    Reply

Leave a Comment

*