How to Get Operating System Details with PowerShell

This article can help you to get the details of your operating system with PowerShell. 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

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

  1. Avatar

    How would I do that with a remote machine?
    Passing PS the user, password, and machine name

    Reply
    • Avatar

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

      Reply

Leave a Comment

*