diff --git a/lib/core.ps1 b/lib/core.ps1 index 8e7b142da..2fb64edb6 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -615,9 +615,9 @@ set invalid=`"=' if !args! == !invalid! ( set args= ) where /q pwsh.exe if %errorlevel% equ 0 ( - pwsh -noprofile -ex unrestricted `"& '$resolved_path' $arg %args%;exit `$lastexitcode`" + pwsh -noprofile -ex unrestricted -command `"& '$resolved_path' $arg %args%;exit `$lastexitcode`" ) else ( - powershell -noprofile -ex unrestricted `"& '$resolved_path' $arg %args%;exit `$lastexitcode`" + powershell -noprofile -ex unrestricted -command `"& '$resolved_path' $arg %args%;exit `$lastexitcode`" )" | Out-File "$shim.cmd" -Encoding ASCII warn_on_overwrite $shim $path