From 02cb390ac67008a52b6916cfb3183ce3dfa33fe7 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Sat, 13 Sep 2025 23:41:25 +0200 Subject: [PATCH] Create restore point before removing apps in Default mode --- Win11Debloat.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index c26ffc0..ba2e4b5 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -1483,6 +1483,10 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa switch ($Mode) { # Default mode, loads defaults after confirmation '1' { + if (-not $script:Params.ContainsKey('CreateRestorePoint')) { + $script:Params.Add('CreateRestorePoint', $true) + } + # Show the default settings with confirmation, unless Silent parameter was passed if (-not $Silent) { # Show options for app removal @@ -1525,12 +1529,16 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa # Select correct option based on user input switch ($RemoveAppsInput) { '1' { - $script:Params.Add('RemoveApps', $true) + if (-not $script:Params.ContainsKey('RemoveApps')) { + $script:Params.Add('RemoveApps', $true) + } Write-Output "- Remove the default selection of apps." } '2' { - $script:Params.Add('RemoveAppsCustom', $true) + if (-not $script:Params.ContainsKey('RemoveAppsCustom')) { + $script:Params.Add('RemoveAppsCustom', $true) + } Write-Output "- Remove your custom selection of $($script:SelectedApps.Count) apps." } @@ -1542,7 +1550,7 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa Read-Host | Out-Null } - $DefaultParameterNames = 'CreateRestorePoint','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','DisableEdgeAds','ShowKnownFileExt','DisableWidgets','HideChat','DisableFastStartup','DisableCopilot' + $DefaultParameterNames = 'DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','DisableEdgeAds','ShowKnownFileExt','DisableWidgets','HideChat','DisableFastStartup','DisableCopilot' PrintHeader 'Default Mode'