How to find the Windows version from the PowerShell command line

前端 未结 25 1178
野的像风
野的像风 2020-12-22 15:51

How do I find which Windows version I\'m using?

I\'m using PowerShell 2.0 and tried:

PS C:\\> ver
The term \'ver\' is not recognized as the name o         


        
25条回答
  •  抹茶落季
    2020-12-22 16:17

    Unfortunately most of the other answers do not provide information specific to Windows 10.

    Windows 10 has versions of its own: 1507, 1511, 1607, 1703, etc. This is what winver shows.

    Powershell:
    (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId
    
    Command prompt (CMD.EXE):
    Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId
    

    See also related question on superuser.

    As for other Windows versions use systeminfo. Powershell wrapper:

    PS C:\> systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List
    
    
    OS Name             : Microsoft Windows 7 Enterprise
    OS Version          : 6.1.7601 Service Pack 1 Build 7601
    OS Manufacturer     : Microsoft Corporation
    OS Configuration    : Standalone Workstation
    OS Build Type       : Multiprocessor Free
    System Type         : x64-based PC
    System Locale       : ru;Russian
    Hotfix(s)           : 274 Hotfix(s) Installed.,[01]: KB2849697,[02]: KB2849697,[03]:...
    

    Windows 10 output for the same command:

    OS Name             : Microsoft Windows 10 Enterprise N 2016 LTSB
    OS Version          : 10.0.14393 N/A Build 14393
    OS Manufacturer     : Microsoft Corporation
    OS Configuration    : Standalone Workstation
    OS Build Type       : Multiprocessor Free
    System Type         : x64-based PC
    System Directory    : C:\Windows\system32
    System Locale       : en-us;English (United States)
    Hotfix(s)           : N/A
    

提交回复
热议问题