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:
- Get-ComputerInfo command
- Get-ItemProperty command
- systeminfo command
- System.Environment command
- Get-CimInstance command
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:
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:
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:
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:
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:
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:
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.