Development

How to Get Windows OS Version using PowerShell

Captain Salem

How to Get Windows OS Version using PowerShell

In this tutorial, you will learn how to use Windows PowerShell commands to determine the OS version of your Windows system.

Method 1 - Using the WMI Object

PowerShell has a Get-WmiObject cmdlet that allows you to fetch information about the Windows Management Instrumentation (WMI) classes. We can use this cmdlet to query the information and then pipe the resulting output to the select command. This will enable us to fetch the OS version as shown in the command below:

Get-WMIObject win32_operatingsystem | Select Version
Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.