fix: make get-cameleer.ps1 safe under irm | iex

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) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-25 15:44:01 +02:00
parent 0b092065c5
commit a9aee77077

View File

@@ -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