Skip to content

Instantly share code, notes, and snippets.

@ChrisWarwick
Last active October 18, 2017 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisWarwick/095c551b89bb9d19e21cea57cba695e3 to your computer and use it in GitHub Desktop.
Save ChrisWarwick/095c551b89bb9d19e21cea57cba695e3 to your computer and use it in GitHub Desktop.
Check Windows Build Information
# 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