Last active
July 5, 2018 06:13
-
-
Save NickStrupat/87d241df53169d20063a95f6547c133f to your computer and use it in GitHub Desktop.
This file contains 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
$isDesktop = $PSEdition -eq "Desktop" | |
$isCore = $PSEdition -eq "Core" | |
if ($isDesktop -or ($isCore -and $IsWindows)) { | |
Write-Output Windows | |
} | |
elseif ($isCore -and $IsLinux) { | |
Write-Output Linux | |
} | |
elseif ($isCore -and $IsMacOS) { | |
Write-Output macOS | |
} | |
else { | |
throw "This version of PowerShell is not supported" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment