Home > other >  How to get the correct Windows version from command line
How to get the correct Windows version from command line

Time:08-22

How to get the correct Windows version from command line, PowerShell included?

As I've tried all solutions/answers from enter image description here

CodePudding user response:

You can retrieve it from the registry:

Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' DisplayVersion

Note:

  • Apparently only works in version 20H2 and above.
  • Prior to that, winver.exe (whose screenshot is shown in the question), apparently showed the ReleaseId registry value (in lieu of DisplayVersion above).

CodePudding user response:

PS> Winver

Not kidding. One would expect this info to be in Get-ComputerInfo, but it isn't.

  • Related