From a14901f79288bb739aa5a2e056c085759327a97b Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:42:21 -0400 Subject: [PATCH] Windows PWSH setup fix (#29649) A command in the script to make Spack accessible in PWSH was invoked with multiple arguments when it in fact requires a single argument. --- bin/spack_pwsh.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/spack_pwsh.ps1 b/bin/spack_pwsh.ps1 index 199d33038c..9747fd3254 100644 --- a/bin/spack_pwsh.ps1 +++ b/bin/spack_pwsh.ps1 @@ -37,8 +37,8 @@ if (!$null -eq $py_path) if (!$null -eq $py_exe) { - Invoke-Expression "$py_exe" "$Env:SPACK_ROOT\bin\haspywin.py" - Invoke-Expression "$py_exe" "$Env:SPACK_ROOT\bin\spack external find python" | Out-Null + Invoke-Expression "$py_exe $Env:SPACK_ROOT\bin\haspywin.py" + Invoke-Expression "$py_exe $Env:SPACK_ROOT\bin\spack external find python" | Out-Null } $Env:Path = "$Env:SPACK_ROOT\bin;$Env:Path" @@ -54,6 +54,6 @@ $command = 'function global:prompt $pth = $(Convert-Path $(Get-Location)) | Split-Path -leaf "[spack] PS $pth>" }' -$bytes = [System.Text.Encoding]::Unicode.GetBytes($command) -$encoded_command = [Convert]::ToBase64String($bytes) +$bytesc = [System.Text.Encoding]::Unicode.GetBytes($command) +$encoded_command = [Convert]::ToBase64String($bytesc) powershell.exe -NoLogo -encodedCommand $encoded_command -NoExit