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
I am refining one of the answers
I reached this question while trying to match the output from winver.exe:
Version 1607 (OS Build 14393.351)
I was able to extract the build string with:
,((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name BuildLabEx).BuildLabEx -split '\.') | % { $_[0..1] -join '.' }
Result: 14393.351
Updated: Here is a slightly simplified script using regex
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").BuildLabEx -match '^[0-9]+\.[0-9]+' | % { $matches.Values }