방법 #1

PS C:\> [Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      14393  0

PS C:\> 

문제점: Deprecated API이다. 추후 업데이트에서 이 API를 지원하지 않을 가능성이 있다.


방법 #2

PS C:\> (Get-WmiObject Win32_OperatingSystem).Version
10.0.14393
PS C:\> 

문제점: Windows 8.1(NT 6.3)에서 6.2로 표시된다.


방법 #3

PS C:\> (Get-CimInstance Win32_OperatingSystem).Version
10.0.14393
PS C:\> 

문제점: Windows 7에서 지원하지 않는다.


방법 #4: KUSER_SHARED_DATA 이용

PS C:\> [Runtime.InteropServices.Marshal]::ReadInt32((New-Object IntPtr(0x7ffe0000)), 0x026C)
10
PS C:\> [Runtime.InteropServices.Marshal]::ReadInt32((New-Object IntPtr(0x7ffe0000)), 0x0270)
0
PS C:\> [Runtime.InteropServices.Marshal]::ReadInt32((New-Object IntPtr(0x7ffe0000)), 0x0260)
14393
PS C:\> 

오프셋은 [여기]를 참고.

문제점: 빌드 번호(0x0260)는 Windows 8 이상 운영체제만 지원한다.


References