mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-23 08:02:07 +00:00
fix: honor cancellation during changes (#700)
Co-authored-by: Jeffrey <9938813+Raphire@users.noreply.github.com>
This commit is contained in:
@@ -563,6 +563,10 @@ if (($controlParamsCount -eq $script:Params.Keys.Count) -or ($script:Params.Keys
|
||||
# (This also handles restore point creation if requested)
|
||||
Invoke-AllChanges
|
||||
|
||||
if ($script:CancelRequested) {
|
||||
Write-Warning "Script execution was cancelled by the user. Any remaining changes were not applied."
|
||||
AwaitKeyToExit
|
||||
}
|
||||
|
||||
# Restart Explorer process unless running in Sysprep or User context
|
||||
if (-not ($script:Params.ContainsKey("Sysprep") -or $script:Params.ContainsKey("User"))) {
|
||||
|
||||
Reference in New Issue
Block a user