Last active
October 18, 2017 09:13
-
-
Save ChrisWarwick/095c551b89bb9d19e21cea57cba695e3 to your computer and use it in GitHub Desktop.
Check Windows Build Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get full Windows Build information, including Revision | |
$WinNtCurrentVersion = 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' | |
$Release = (Get-ItemProperty -Path $WinNtCurrentVersion -Name ReleaseId).ReleaseId | |
$Major = (Get-ItemProperty -Path $WinNtCurrentVersion -Name CurrentMajorVersionNumber).CurrentMajorVersionNumber | |
$Minor = (Get-ItemProperty -Path $WinNtCurrentVersion -Name CurrentMinorVersionNumber).CurrentMinorVersionNumber | |
$Build = (Get-ItemProperty -Path $WinNtCurrentVersion -Name CurrentBuild).CurrentBuild | |
$Revision = (Get-ItemProperty -Path $WinNtCurrentVersion -Name UBR).UBR | |
[PsCustomObject] @{ | |
Release = $Release | |
Major = $Major | |
Minor = $Minor | |
Build = $Build | |
Revision = $Revision | |
Version = [System.Version]::New($Major, $Minor, $Build, $Revision) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment