diff --git a/bootstrap-Windows.ps1 b/bootstrap-Windows.ps1 index eaa6823..a6c5325 100644 --- a/bootstrap-Windows.ps1 +++ b/bootstrap-Windows.ps1 @@ -11,11 +11,16 @@ if (-Not $IsElevated) { Invoke-WebRequest -Uri https://get.scoop.sh -OutFile $ScoopInstaller &$ScoopInstaller -ScoopDir "$env:LocalAppData/Scoop" -ScoopGlobalDir "$env:ProgramData/Scoop" + $Bootstrap = $MyInvocation.MyCommand.Path $Decision = $Host.UI.PromptForChoice('Relaunch as Administrator', 'Proceed?', $Choices, 0) if ($Decision -eq 0) { - $Bootstrap = $MyInvocation.MyCommand.Path Start-Process powershell.exe "-ExecutionPolicy ByPass -NoProfile -File $Bootstrap" -Verb RunAs } + + $Decision = $Host.UI.PromptForChoice("Remove $Bootstrap", "Proceed?", $Choices, 1) + if ($Decision -eq 0) { + Remove-Item $Bootstrap -Force + } } else { Write-Host "Running as Administrator. Performing privileged actions."