Windows PowerShell:
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name BuildLab).BuildLab
14955.rs_prerelease.161020-1700
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name BuildLabEx).BuildLabEx
14955.1000.amd64fre.rs_prerelease.161020-1700
Bash on Ubuntu on Windows:
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -command "(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name BuildLabEx).BuildLabEx"
14955.1000.amd64fre.rs_prerelease.161020-1700