From 2574e725bc4a69e58c2afcae76439f76c01d7495 Mon Sep 17 00:00:00 2001 From: Jeffrey <9938813+Raphire@users.noreply.github.com> Date: Sat, 6 Jun 2026 00:51:03 +0200 Subject: [PATCH] Remove RemoveCommApps and RemoveW11Outlook presets These are largely redundant. Use -RemoveApps parameter instead --- Config/Features.json | 42 ++------ Scripts/Features/ExecuteChanges.ps1 | 144 +++++++++++++--------------- Scripts/Get-Dev.ps1 | 2 - Scripts/Get.ps1 | 2 - Win11Debloat.ps1 | 2 - 5 files changed, 76 insertions(+), 116 deletions(-) diff --git a/Config/Features.json b/Config/Features.json index 33bda37..b244314 100644 --- a/Config/Features.json +++ b/Config/Features.json @@ -319,36 +319,12 @@ "MinVersion": null, "MaxVersion": null }, - { - "FeatureId": "RemoveCommApps", - "Label": "Remove the Mail, Calendar, and People apps", - "Category": null, - "RegistryKey": null, - "ApplyText": "Removing selected apps...", - "UndoLabel": null, - "ApplyUndoText": null, - "RegistryUndoKey": null, - "MinVersion": null, - "MaxVersion": null - }, - { - "FeatureId": "RemoveW11Outlook", - "Label": "Remove the new Outlook for Windows app", - "Category": null, - "RegistryKey": null, - "ApplyText": "Removing selected apps...", - "UndoLabel": null, - "ApplyUndoText": null, - "RegistryUndoKey": null, - "MinVersion": null, - "MaxVersion": null - }, { "FeatureId": "RemoveGamingApps", "Label": "Remove the Xbox App and Xbox Gamebar", "Category": null, "RegistryKey": null, - "ApplyText": "Removing selected apps...", + "ApplyText": "Removing gaming related apps...", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -360,7 +336,7 @@ "Label": "Remove HP OEM applications", "Category": null, "RegistryKey": null, - "ApplyText": "Removing selected apps...", + "ApplyText": "Removing HP apps...", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -553,7 +529,7 @@ "Label": "Remove all pinned apps from the start menu for this user only", "Category": "Start Menu & Search", "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Removing all pinned apps from the start menu", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -565,7 +541,7 @@ "Label": "Remove all pinned apps from the start menu for all existing and new users", "Category": "Start Menu & Search", "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Removing all pinned apps from the start menu for all users", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -577,7 +553,7 @@ "Label": "Replace the start menu layout for this user only with the provided template file", "Category": null, "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Replacing the start menu", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -589,7 +565,7 @@ "Label": "Replace the start menu layout for all existing and new users with the provided template file", "Category": null, "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Replacing the start menu for all users", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -654,7 +630,7 @@ "ToolTip": "This will disable the Microsoft Store app suggestions in Windows search.", "Category": "Start Menu & Search", "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Disabling Microsoft Store app suggestions in search...", "UndoLabel": "Enable Microsoft Store app suggestions in search", "ApplyUndoText": "Enabling Microsoft Store app suggestions in search...", "RegistryUndoKey": null, @@ -966,7 +942,7 @@ "Category": "Taskbar", "Priority": 4, "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Disabling widgets on the taskbar & lock screen...", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, @@ -1365,7 +1341,7 @@ "Label": "Forcefully uninstall Microsoft Edge. NOT RECOMMENDED!", "Category": null, "RegistryKey": null, - "ApplyText": null, + "ApplyText": "Forcefully uninstalling Microsoft Edge...", "UndoLabel": null, "ApplyUndoText": null, "RegistryUndoKey": null, diff --git a/Scripts/Features/ExecuteChanges.ps1 b/Scripts/Features/ExecuteChanges.ps1 index 07f504d..2152fb9 100644 --- a/Scripts/Features/ExecuteChanges.ps1 +++ b/Scripts/Features/ExecuteChanges.ps1 @@ -1,55 +1,3 @@ -# Resolves the path of an undo reg file relative to $script:RegfilesPath. -# Checks the Undo/ subfolder first, then falls back to the root Regfiles/ folder. -function Resolve-UndoRegFilePath { - param ([string]$FileName) - $undoSubPath = Join-Path 'Undo' $FileName - if (Test-Path (Join-Path $script:RegfilesPath $undoSubPath)) { - return $undoSubPath - } - return $FileName -} - -function Invoke-UndoFeatureAction { - param( - [Parameter(Mandatory)] - [string]$FeatureId - ) - - switch ($FeatureId) { - 'DisableStoreSearchSuggestions' { - if ($script:Params.ContainsKey('Sysprep')) { - Write-Host "> Re-enabling Microsoft Store search suggestions in the start menu for all users..." - EnableStoreSearchSuggestionsForAllUsers - Write-Host "" - return - } - - Write-Host "> Re-enabling Microsoft Store search suggestions for user $(GetUserName)..." - EnableStoreSearchSuggestions - Write-Host "" - return - } - 'EnableWindowsSandbox' { - Write-Host "> Disabling Windows Sandbox..." - DisableWindowsFeature 'Containers-DisposableClientVM' - Write-Host "" - return - } - 'EnableWindowsSubsystemForLinux' { - Write-Host "> Disabling Windows Subsystem for Linux..." - DisableWindowsFeature 'Microsoft-Windows-Subsystem-Linux' - DisableWindowsFeature 'VirtualMachinePlatform' - Write-Host "" - return - } - default { - Write-Host "> No undo action defined for $FeatureId, skipping..." -ForegroundColor Yellow - Write-Host "" - return - } - } -} - # Executes a single parameter/feature based on its key # Parameters: # $paramKey - The parameter name to execute @@ -85,7 +33,7 @@ function ExecuteParameter { # Handle features without RegistryKey or with special logic switch ($paramKey) { 'RemoveApps' { - Write-Host "> Removing selected apps for $(GetFriendlyTargetUserName)..." + Write-Host "> $($feature.ApplyText) for $(GetFriendlyTargetUserName)..." $appsList = GenerateAppsList if ($appsList.Count -eq 0) { @@ -98,7 +46,7 @@ function ExecuteParameter { RemoveApps $appsList } 'RemoveAppsCustom' { - Write-Host "> Removing selected apps..." + Write-Host "> $($feature.ApplyText)..." $appsList = LoadAppsFromFile $script:CustomAppsListFilePath if ($appsList.Count -eq 0) { @@ -110,58 +58,46 @@ function ExecuteParameter { Write-Host "$($appsList.Count) apps selected for removal" RemoveApps $appsList } - 'RemoveCommApps' { - $appsList = @('Microsoft.windowscommunicationsapps', 'Microsoft.People') - Write-Host "> Removing Mail, Calendar and People apps..." - RemoveApps $appsList - return - } - 'RemoveW11Outlook' { - $appsList = @('Microsoft.OutlookForWindows') - Write-Host "> Removing new Outlook for Windows app..." - RemoveApps $appsList - return - } 'RemoveGamingApps' { $appsList = @('Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay') - Write-Host "> Removing gaming related apps..." + Write-Host "> $($feature.ApplyText)..." RemoveApps $appsList return } 'RemoveHPApps' { $appsList = @('AD2F1837.HPAIExperienceCenter', 'AD2F1837.HPJumpStarts', 'AD2F1837.HPPCHardwareDiagnosticsWindows', 'AD2F1837.HPPowerManager', 'AD2F1837.HPPrivacySettings', 'AD2F1837.HPSupportAssistant', 'AD2F1837.HPSureShieldAI', 'AD2F1837.HPSystemInformation', 'AD2F1837.HPQuickDrop', 'AD2F1837.HPWorkWell', 'AD2F1837.myHP', 'AD2F1837.HPDesktopSupportUtilities', 'AD2F1837.HPQuickTouch', 'AD2F1837.HPEasyClean', 'AD2F1837.HPConnectedMusic', 'AD2F1837.HPFileViewer', 'AD2F1837.HPRegistration', 'AD2F1837.HPWelcome', 'AD2F1837.HPConnectedPhotopoweredbySnapfish', 'AD2F1837.HPPrinterControl') - Write-Host "> Removing HP apps..." + Write-Host "> $($feature.ApplyText)..." RemoveApps $appsList return } 'DisableWidgets' { - Write-Host "> Disabling widgets on the taskbar & lock screen..." + Write-Host "> $($feature.ApplyText)..." # Stop widgets related processes before removing the app packages to prevent potential issues Get-Process *Widget* -ErrorAction SilentlyContinue | Stop-Process - + RemoveApps @('Microsoft.StartExperiencesApp','MicrosoftWindows.Client.WebExperience','Microsoft.WidgetsPlatformRuntime') } - "EnableWindowsSandbox" { - Write-Host "> Enabling Windows Sandbox..." + 'EnableWindowsSandbox' { + Write-Host "> $($feature.ApplyText)..." EnableWindowsFeature "Containers-DisposableClientVM" Write-Host "" return } - "EnableWindowsSubsystemForLinux" { - Write-Host "> Enabling Windows Subsystem for Linux..." + 'EnableWindowsSubsystemForLinux' { + Write-Host "> $($feature.ApplyText)..." EnableWindowsFeature "VirtualMachinePlatform" EnableWindowsFeature "Microsoft-Windows-Subsystem-Linux" Write-Host "" return } 'ClearStart' { - Write-Host "> Removing all pinned apps from the start menu for user $(GetUserName)..." + Write-Host "> $($feature.ApplyText) for user $(GetUserName)..." ReplaceStartMenu Write-Host "" return } 'ReplaceStart' { - Write-Host "> Replacing the start menu for user $(GetUserName)..." + Write-Host "> $($feature.ApplyText) for user $(GetUserName)..." ReplaceStartMenu $script:Params.Item("ReplaceStart") Write-Host "" return @@ -309,4 +245,58 @@ function ExecuteAllChanges { Write-Host "" Write-Host "$($script:RegistryImportFailures) registry import change(s) failed. See output above for details." -ForegroundColor Yellow } -} \ No newline at end of file +} + +# Resolves the path of an undo reg file relative to $script:RegfilesPath. +# Checks the Undo/ subfolder first, then falls back to the root Regfiles/ folder. +function Resolve-UndoRegFilePath { + param ([string]$FileName) + $undoSubPath = Join-Path 'Undo' $FileName + if (Test-Path (Join-Path $script:RegfilesPath $undoSubPath)) { + return $undoSubPath + } + return $FileName +} + +function Invoke-UndoFeatureAction { + param( + [Parameter(Mandatory)] + [string]$FeatureId + ) + + $feature = if ($script:Features.ContainsKey($FeatureId)) { $script:Features[$FeatureId] } else { $null } + + switch ($FeatureId) { + 'DisableStoreSearchSuggestions' { + if ($script:Params.ContainsKey('Sysprep')) { + Write-Host "> Re-enabling Microsoft Store search suggestions in the start menu for all users..." + EnableStoreSearchSuggestionsForAllUsers + Write-Host "" + return + } + + Write-Host "> Re-enabling Microsoft Store search suggestions for user $(GetUserName)..." + EnableStoreSearchSuggestions + Write-Host "" + return + } + 'EnableWindowsSandbox' { + Write-Host "> $($feature.ApplyUndoText)..." + DisableWindowsFeature 'Containers-DisposableClientVM' + Write-Host "" + return + } + 'EnableWindowsSubsystemForLinux' { + Write-Host "> $($feature.ApplyUndoText)..." + DisableWindowsFeature 'Microsoft-Windows-Subsystem-Linux' + DisableWindowsFeature 'VirtualMachinePlatform' + Write-Host "" + return + } + default { + Write-Host "> No undo action defined for $FeatureId, skipping..." -ForegroundColor Yellow + Write-Host "" + return + } + } +} diff --git a/Scripts/Get-Dev.ps1 b/Scripts/Get-Dev.ps1 index 45f43e6..37f7c38 100644 --- a/Scripts/Get-Dev.ps1 +++ b/Scripts/Get-Dev.ps1 @@ -17,9 +17,7 @@ param ( [switch]$RemoveApps, [switch]$RemoveAppsCustom, [switch]$RemoveGamingApps, - [switch]$RemoveCommApps, [switch]$RemoveHPApps, - [switch]$RemoveW11Outlook, [switch]$ForceRemoveEdge, [switch]$DisableDVR, [switch]$DisableGameBarIntegration, diff --git a/Scripts/Get.ps1 b/Scripts/Get.ps1 index 88d2f72..619b27d 100644 --- a/Scripts/Get.ps1 +++ b/Scripts/Get.ps1 @@ -17,9 +17,7 @@ param ( [switch]$RemoveApps, [switch]$RemoveAppsCustom, [switch]$RemoveGamingApps, - [switch]$RemoveCommApps, [switch]$RemoveHPApps, - [switch]$RemoveW11Outlook, [switch]$ForceRemoveEdge, [switch]$DisableDVR, [switch]$DisableGameBarIntegration, diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 3cce8d3..6c1d9fa 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -17,9 +17,7 @@ param ( [switch]$RemoveApps, [switch]$RemoveAppsCustom, [switch]$RemoveGamingApps, - [switch]$RemoveCommApps, [switch]$RemoveHPApps, - [switch]$RemoveW11Outlook, [switch]$ForceRemoveEdge, [switch]$DisableDVR, [switch]$DisableGameBarIntegration,