From e9bccccc0969feb67b2d36181466933df7b12de4 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:47:46 +0100 Subject: [PATCH] Add error handling for ExecuteAllChanges to improve robustness --- Win11Debloat.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 410a54d..d795ef2 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -468,9 +468,17 @@ if (($controlParamsCount -eq $script:Params.Keys.Count) -or ($script:Params.Keys AwaitKeyToExit } -# Execute all selected/provided parameters using the consolidated function -# (This also handles restore point creation if requested) -ExecuteAllChanges +try { + # Execute all selected/provided parameters using the consolidated function + # (This also handles restore point creation if requested) + ExecuteAllChanges +} +catch { + Write-Error "An error occurred while applying changes: $_" + + AwaitKeyToExit +} + RestartExplorer