Created
January 8, 2020 20:43
-
-
Save Goadstir/cff4178ec13f7c325de76809bfa89ca0 to your computer and use it in GitHub Desktop.
PowerShell: Check if endpoint is a Desktop or Server OS
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
| $OS = ((Get-WmiObject Win32_OperatingSystem).Name).Split("|")[0] | |
| # Checking for Windows 7 or Windows 10 in Name | |
| If ($OS -contains "7" -or "10") {Write-Host "It's a Desktop!"} | |
| Else {Write-Host "It's a Server!"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment