From 379a301bf3e5933a5a4e1ed1e92f5a430a815beb Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 11 Jan 2024 14:44:21 -0700 Subject: [PATCH] fix(windows): 'powershell -File ...' to work with $HOME with spaces --- psscriptanalyzer/install.ps1 | 2 +- pwsh-essentials/install.ps1 | 4 ++-- webi/webi-pwsh.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/psscriptanalyzer/install.ps1 b/psscriptanalyzer/install.ps1 index 9ae6526..2416d43 100644 --- a/psscriptanalyzer/install.ps1 +++ b/psscriptanalyzer/install.ps1 @@ -13,7 +13,7 @@ function Repair-MissingCommand { Return } - & $HOME\.local\bin\webi-pwsh.ps1 $Package + & "$HOME\.local\bin\webi-pwsh.ps1" $Package $null = Sync-EnvPath } diff --git a/pwsh-essentials/install.ps1 b/pwsh-essentials/install.ps1 index 08e2a50..a0853a7 100644 --- a/pwsh-essentials/install.ps1 +++ b/pwsh-essentials/install.ps1 @@ -15,7 +15,7 @@ function Repair-MissingCommand { Return } - & $HOME\.local\bin\webi-pwsh.ps1 $Package + & "$HOME\.local\bin\webi-pwsh.ps1" $Package $null = Sync-EnvPath } @@ -47,7 +47,7 @@ function Install-PwshEssential { Repair-MissingCommand -Name "PowerShell Core" -Package "pwsh" -Command "pwsh" # Fetch PSScriptAnalyzer (fmt, lint, fix) - & $HOME\.local\bin\webi-pwsh.ps1 psscriptanalyzer + & "$HOME\.local\bin\webi-pwsh.ps1" psscriptanalyzer # Fetch shorthand commands to fmt, lint, & fix $ScriptNames = , "pwsh-fmt", "pwsh-fix", "pwsh-lint" diff --git a/webi/webi-pwsh.ps1 b/webi/webi-pwsh.ps1 index cfe534b..81110f6 100755 --- a/webi/webi-pwsh.ps1 +++ b/webi/webi-pwsh.ps1 @@ -199,7 +199,7 @@ $UrlParams = "formats=zip,exe,tar,git&libc=msvc" $PkgInstallPwsh = "$HOME\.local\tmp\$exename.install.ps1" Invoke-DownloadUrl -Force -URL $PKG_URL -Params $UrlParams -Path $PkgInstallPwsh -powershell $HOME\.local\tmp\${exename}.install.ps1 +powershell -File "$HOME\.local\tmp\${exename}.install.ps1" IF ($IsWebiParent) { Write-Host ""