Windows Build number and patch level

The easiest way how to get the installed OS build number with current patch level is via registry:

Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | Select ReleaseId, CurrentBuild, UBR