Skip to content

Commit da4e181

Browse files
committed
fix(scoop): use sub-expression expansion to prevent quote stripping in scoop installer patch
1 parent 096986f commit da4e181

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Services/Bootstrappers/ScoopBootstrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void Install(bool dryRun)
4949
}
5050

5151
// Use -ExecutionPolicy Bypass as a process argument and dynamically patch Get-ExecutionPolicy calls in the script to avoid runner module-loading crashes
52-
string command = "irm get.scoop.sh -outfile install.ps1; (Get-Content install.ps1) -replace 'Get-ExecutionPolicy', '\"RemoteSigned\"' | Set-Content install.ps1; .\\install.ps1 -RunAsAdmin; if (Test-Path .\\install.ps1) { Remove-Item .\\install.ps1 }";
52+
string command = "irm get.scoop.sh -outfile install.ps1; (Get-Content install.ps1).Replace('(Get-ExecutionPolicy).ToString()', '\"$([char]39)RemoteSigned$([char]39)\"') | Set-Content install.ps1; .\\install.ps1 -RunAsAdmin; if (Test-Path .\\install.ps1) { Remove-Item .\\install.ps1 }";
5353

5454
for (int attempt = 0; attempt < MaxRetries; attempt++)
5555
{

0 commit comments

Comments
 (0)