diff --git a/samy.ps1 b/samy.ps1 index 3caa9dd..339e205 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -19,9 +19,11 @@ if ($ExecutionContext.SessionState.LanguageMode -ne 'FullLanguage' -or if ($PSCommandPath) { powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PSCommandPath" @argList } else { - $argString = ($argList | ForEach-Object { '"' + ($_ -replace '"','`"') + '"' }) -join ' ' - powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& { iwr 'https://samybeta.svstools.ca' -UseBasicParsing | iex } $argString" + # IMPORTANT: pass args AFTER -Command so they become $args in the downloaded script + $bootstrap = "& { iwr 'https://samybeta.svstools.ca' -UseBasicParsing | iex }" + powershell.exe -NoProfile -ExecutionPolicy Bypass -Command $bootstrap @argList } + exit }