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