How to get the correct Windows version from command line, PowerShell included?
As I've tried all solutions/answers from
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 theReleaseId
registry value (in lieu ofDisplayVersion
above).
CodePudding user response:
PS> Winver
Not kidding. One would expect this info to be in Get-ComputerInfo, but it isn't.