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

How to Get Operating System Details with PowerShell
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

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

  • Avatar
    November 18, 2019 at 12:04 am
    Permalink

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

    Reply
    • Avatar
      January 14, 2020 at 11:28 am
      Permalink

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

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*