When you run winver.exe, you can easily retrieve the full Windows build number. Reading the build number from PowerShell is not as obvious. There is no a built-in cmdlet.

However, it’s easy to create a simple function that does it for you:

function Get-OSInfo
{
  $path = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
  Get-ItemProperty -Path $path -Name CurrentBuild, UBR, ReleaseID, CompositionEditionID |
     Select-Object -Property CurrentBuild, UBR, ReleaseID, CompositionEditionID

  
}

The result will look similar to this:

 
PS C:\> Get-OSInfo

CurrentBuild  UBR ReleaseId CompositionEditionID
------------  --- --------- --------------------
15063        1088 1703      Enterprise 
 

Twitter This Tip! ReTweet this Tip!

Anonymous