PowerShell: Get Windows Version

Windows version mismatches cause more troubleshooting headaches than they should. This one-liner gets you the exact build in seconds.

Prerequisites:

  • Privileges: None
  • Module: Built-in, no import needed

Quick Command:

Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, Version

Example Output:

Caption                  Version
-------                  -------
Microsoft Windows 11 Pro 10.0.26200
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

How It Works:

  • Get-CimInstance queries the Win32_OperatingSystem WMI class, which stores information about the installed operating system.
  • Caption shows the human-readable edition name (e.g. Windows 11 Pro, Windows 10 Enterprise).
  • Version shows the internal build version in major.minor.build format - this is the number you'll want when checking application compatibility or confirming whether a machine has a specific feature update installed.
  • Select-Object limits the output to just these two properties, since Win32_OperatingSystem returns a lot more data (like BuildNumber, OSArchitecture, or InstallDate) that isn't needed for a quick version check.