Windows OS

How to Find the Windows Version Using PowerShell

Windows is a well-liked and commonly used operating system for personal computers. Each of its latest versions introduces advanced features that enhance the Graphical User Interface of the system. As a Windows user, there exist some scenarios where you need to check the Windows version for knowledge sake or to install some software supported by specific versions of Windows.

In this article, we will illustrate the technique to find the Windows version using PowerShell. Let’s get started!

How to Find the Windows Version Using PowerShell?

The Windows PowerShell can find out the Windows version using:

We will discuss each of them one by one.

Method 1: Find the Windows Version Using Get-ComputerInfo

In the first approach, we will utilize the “Get-ComputerInfo” command. To do so, follow the given procedure.

Step 1: Open Windows PowerShell

Firstly, press “Window+R”, type “PowerShell”, and click on the “OK” button to open Windows PowerShell:

Step 2: Execute “Get-ComputerInfo” command

Next, execute the “Get-ComputerInfo” to check out the Windows version on PowerShell. The below-provided command will show the Windows Product Name, Windows Version, and the Os Hardware information:

> Get-ComputerInfo | select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer

You can see that we are using the Windows “2009” version:

Using the pipe operator “|”, you can also filter out the above output to only fetch the Windows version:

> Get-ComputerInfo | select windowsversion

Method 2: Find the Windows Version Using Get-ItemProperty

The “Get-ItemProperty” command can also display the Windows version using the below-provided Registry Key. The provided Registry contains all the Windows Net Technology information:

> (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId

The output indicates that the currently running Windows version is “2009”:

Method 3: Find the Windows Version Using systeminfo

To find the Windows version on PowerShell, you can utilize the “systeminfo”. This command will list down the complete details of your system, including the OS version:

> systeminfo

Method 4: Find the Windows Version Using [System.Environment]

The “[System.Environment]” class can also be used to view the Windows version. To do so, access the value of its “OSVersion.Version” property:

> [System.Environment]::OSVersion.Version

Method 5: Find the Windows Version Using Get-CimInstance

Run the “Get-CimInstance” command to get the information about the Windows version. For this reason, we have used specified “Win32_OperatingSystem” as our OS:

> (Get-CimInstance Win32_OperatingSystem).version

We have compiled different PowerShell commands used to find the Windows Version.

Conclusion

To find out the Windows version, you can utilize the following PowerShell “Get-ComputerInfo” command, “Get-ItemProperty” command, “systeminfo” command, “System.Environment” command, and “Get-CimInstance” command. All of these commands can display the Windows version along with other related information. This article discussed the usage of the PowerShell commands for finding the Windows version.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.