# Windows version (as in VER command) [Environment]::OSVersion # or, using WMI: Get-CimInstance -Class Win32_OperatingSystem # Windows edition (requires elevated privileges): Get-WindowsEdition –Online # friendly name (as in WinVer command): $winver = ( Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ) "{0} {1}" -f $winver.ProductName, $winver.DisplayVersion