PowerShell 與 PowerShell ISE 中的環境.OSVersion

PowerShell 與 PowerShell ISE 中的環境.OSVersion

為什麼我在 PowerShell 和 PowerShell ISE 中看到 2 個不同版本的作業系統?

作業系統:Microsoft Windows Server 2012 R2 資料中心評估

PowerShell:版本 4.0

電源外殼

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

Major  Minor  Build  Revision
-----  -----  -----  --------
6      3      9600   0

PowerShell ISE

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

Major  Minor  Build  Revision
-----  -----  -----  --------
6      2      9200   0       

答案1

Windows 8.1/Server 2012 GetVersionEx如果應用程式不包含 Windows 8.1 支援的作業系統 ID,則傳回 Windows 8 (6.2 Build 9200) 的資料。

看起來 GUI 不包含此條目。

相關內容