Skip to content

Instantly share code, notes, and snippets.

@EmmanuelTsouris
Created November 28, 2016 18:09
Show Gist options
  • Save EmmanuelTsouris/46475a211e191ca68d334b761dfe749b to your computer and use it in GitHub Desktop.
Save EmmanuelTsouris/46475a211e191ca68d334b761dfe749b to your computer and use it in GitHub Desktop.
Windows Server SKU
$(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