feat(uninstall): accept y/N confirmation in powershell script
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cacb3e3bf1
commit
f2910df050
1 file changed
+4
-3
@@ -26,9 +26,10 @@ if (-not $DryRun -and -not $Force) {
|
||||
}
|
||||
Write-Host "This removes the managed configuration, extensions, and semantic retrieval setup for $Client under $homePath."
|
||||
Write-Host 'Backups already on disk are kept; anything this setup never installed is left untouched.'
|
||||
$confirm = [Console]::ReadLine()
|
||||
if ($null -eq $confirm -or $confirm.Trim().ToLowerInvariant() -ne 'yes') {
|
||||
Write-Output "Type 'yes' to continue: cancelled, nothing was removed."
|
||||
$confirm = Read-Host -Prompt 'Continue? [y/N]'
|
||||
if ($null -eq $confirm) { $confirm = '' }
|
||||
if ($confirm.Trim().ToLowerInvariant() -notin @('y', 'yes')) {
|
||||
Write-Output 'Cancelled, nothing was removed.'
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user