diff --git a/install-self-hosted-toolbox.ps1 b/install-self-hosted-toolbox.ps1 index 664a18e8..9dc853ef 100644 --- a/install-self-hosted-toolbox.ps1 +++ b/install-self-hosted-toolbox.ps1 @@ -1,6 +1,8 @@ $ErrorActionPreference = "Stop" -if ($IsWindows) { +# PowerShell Core 6.0+ has $isWindows set, but older versions don't. +# For those versions, we use the $env:OS variable, which is only set in Windows. +if ($IsWindows -or $env:OS) { $ModulePath = $Env:PSModulePath.Split(";")[0] } else { $ModulePath = $Env:PSModulePath.Split(":")[0]