简体   繁体   中英

Why is Winver showing another Version than Powershell?

Winver VS Powershell 输出

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM