From a9aee770770f2df3b4663869c09a43841fdb403b Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sat, 25 Apr 2026 15:44:01 +0200 Subject: [PATCH] fix: make get-cameleer.ps1 safe under irm | iex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iex evaluates the script body in the caller's scope, so top-level side effects leak into the user's interactive PowerShell. Two leaks fixed: - Dropped 'exit $LASTEXITCODE' — would close the user's shell window. - Dropped 'Set-Location $Dir' — would leave the user sitting in .\installer\ after the run. install.ps1 uses $PSScriptRoot to find its templates, so it can be invoked from any CWD via its full path. Co-Authored-By: Claude Opus 4.7 (1M context) --- get-cameleer.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/get-cameleer.ps1 b/get-cameleer.ps1 index 5184fed..e936ead 100644 --- a/get-cameleer.ps1 +++ b/get-cameleer.ps1 @@ -51,10 +51,9 @@ Write-Host '' Write-Host "Installer downloaded to $Dir\ — launching..." Write-Host '' -Set-Location $Dir +$installerPath = Join-Path $Dir 'install.ps1' if ($InstallerArgs) { - & .\install.ps1 @InstallerArgs + & $installerPath @InstallerArgs } else { - & .\install.ps1 + & $installerPath } -exit $LASTEXITCODE