'Why is Winver showing another Version than Powershell?

Winver VS Powershell Output

Hello Guys! Why is Winver showing me Windows Version 21H2 but Powershell Command 2009?

Get-ComputerInfo | select WindowsProductName, WindowsVersion

Info: With my Personal PC at home Windows 11 Pro 21H2, it works with the command

Get-ComputerInfo | Select-Object -expand OSDisplayVersion

Unfortunately this Property doesn`t exist at my Laptop, or maybe in general at Win10 Enterprise?



Solution 1:[1]

You can mimic the way winver.exe shows the current Windows version by taking the values from the registry:

$v = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
# output like winver does
'Version {0} (Build {1}.{2})' -f $v.DisplayVersion, $v.CurrentBuildNumber, $v.UBR

Output:

Version 21H2 (Build 19044.1645)

UBR means Update Build Revision

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Theo