diff --git a/scripts/install-powershell.ps1 b/scripts/install-powershell.ps1 index d8838ae8..617a753f 100755 --- a/scripts/install-powershell.ps1 +++ b/scripts/install-powershell.ps1 @@ -64,7 +64,11 @@ if (-not $Destination) { if ($IsWinEnv) { $Destination = "$env:LOCALAPPDATA\Microsoft\powershell" } else { - $Destination = "~/.powershell" + if (Test-Path "/opt/PowerShell" -pathType container) { + $Destination = "/opt/PowerShell" + } else { + $Destination = "~/.powershell" + } } if ($Daily) {