fix: honor cancellation during changes (#700)

Co-authored-by: Jeffrey <9938813+Raphire@users.noreply.github.com>
This commit is contained in:
Kushida
2026-07-14 22:06:40 +02:00
committed by GitHub
co-authored by Jeffrey
parent 8fa1332ff0
commit de817399e6
3 changed files with 37 additions and 81 deletions
+4
View File
@@ -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"))) {