Created
November 28, 2016 18:09
-
-
Save EmmanuelTsouris/46475a211e191ca68d334b761dfe749b to your computer and use it in GitHub Desktop.
Windows Server SKU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU | |
#region Nano server check | |
Switch -Exact ($(Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU) { | |
143 { | |
Write-Verbose -Message 'Script Running on Windows Server Datacenter Edition (Nano Server installation)' | |
break; | |
} | |
144 { | |
Write-Verbose -Message 'Windows Server Standard Edition (Nano Server installation)' | |
break; | |
} | |
default { | |
Write-Warning -Message 'OperatingSystem SKU does not match Nano server.' | |
throw | |
} | |
} | |
#enderegion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment