Why is Winver showing another Version than Powershell?

1k Views Asked by At

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?

1

There are 1 best solutions below

1
On

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