Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .SYNOPSIS
- Unified Windows 10/11 Debloater (safe)
- - Removes selected bloat per OS (Win10 & Win11 aware)
- - Keeps user apps & Microsoft Store stack
- - Trims telemetry/ads/scheduled tasks (reversible)
- Run as Administrator.
- Edit the two sections below if you want to keep/remove more.
- #>
- # =========================
- # 0) PREP & ADMIN CHECK
- # =========================
- if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()
- ).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
- Write-Host "Please run this script as Administrator!" -ForegroundColor Red
- exit 1
- }
- $ErrorActionPreference = 'SilentlyContinue'
- $ProgressPreference = 'SilentlyContinue'
- # Detect OS (Win10 vs Win11) using build number
- $build = [Environment]::OSVersion.Version.Build
- $IsWin11 = ($build -ge 22000)
- $OsName = if ($IsWin11) { 'Windows 11' } else { 'Windows 10' }
- Write-Host "`n== Unified Debloater ($OsName) ==" -ForegroundColor Cyan
- # =========================
- # 1) KEEP LIST (DO-NOT-TOUCH)
- # =========================
- # Your installed apps + essentials
- $KeepNames = @(
- # Your user apps (from your dump)
- '5319275A.WhatsAppDesktop', # WhatsApp Desktop
- 'DropboxInc.Dropbox', # Dropbox
- 'NotepadPlusPlus', # Notepad++
- 'WinMerge', # WinMerge
- 'WinRAR.ShellExtension', # WinRAR Shell Extension
- '53621FSApps.FluentTerminal',# Fluent Terminal
- # Dev tools you said to keep
- 'MicrosoftCorporationII.WindowsSubsystemForLinux', # WSL
- 'Microsoft.WindowsTerminal', # Windows Terminal
- # Store / winget stack (keep to avoid breaking Store & installers)
- 'Microsoft.WindowsStore',
- 'Microsoft.StorePurchaseApp',
- 'Microsoft.DesktopAppInstaller',
- 'Microsoft.Winget.Source'
- )
- function Test-IsKept([string]$name) { return $KeepNames -contains $name }
- # =========================
- # 2) REMOVAL LISTS
- # =========================
- # 2a) Shared bloat (Win10 & Win11) — safe to remove
- $CommonRemove = @(
- # Xbox surface (if you don't game)
- 'Microsoft.Xbox.TCUI',
- 'Microsoft.XboxIdentityProvider',
- 'Microsoft.XboxSpeechToTextOverlay',
- 'Microsoft.XboxGameCallableUI',
- # Microsoft promos/assistants
- 'Microsoft.GetHelp',
- 'Microsoft.M365Companions',
- 'Microsoft.Edge.GameAssist',
- # Consumer media app (remove if unused)
- 'Microsoft.ZuneMusic'
- )
- # 2b) Win11-only adds
- $Win11Only = @(
- # Widgets / Web Experience / Copilot surface
- 'MicrosoftWindows.Client.WebExperience',
- # OEM / GPU control panels (drivers remain)
- 'AD2F1837.HPAudioCenter',
- 'AppUp.IntelGraphicsExperience',
- 'AdvancedMicroDevicesInc-2.AMDRadeonSoftware'
- )
- # 2c) Win10-only classics (safe to remove if present)
- $Win10Only = @(
- 'Microsoft.3DBuilder',
- 'Microsoft.Print3D',
- 'Microsoft.Microsoft3DViewer',
- 'Microsoft.Getstarted',
- 'Microsoft.BingNews',
- 'Microsoft.BingWeather',
- 'Microsoft.MicrosoftSolitaireCollection',
- 'Microsoft.SkypeApp',
- 'Microsoft.MinecraftUWP',
- 'Microsoft.Whiteboard',
- 'Microsoft.WindowsAlarms',
- 'Microsoft.WindowsFeedbackHub',
- 'Microsoft.WindowsMaps',
- 'Microsoft.MixedReality.Portal',
- 'Microsoft.XboxApp',
- 'Microsoft.XboxGameOverlay',
- 'Microsoft.XboxGamingOverlay',
- 'Microsoft.People', # (legacy People app tile)
- 'Microsoft.OneConnect', # (Mobile plans / messaging)
- 'Microsoft.Office.OneNote', # (Store OneNote; O365 OneNote desktop remains)
- 'Microsoft.Wallet'
- # NOTE: If you really want to remove Sticky Notes / Paint / Camera / Calculator,
- # add: 'Microsoft.MicrosoftStickyNotes','Microsoft.MSPaint','Microsoft.WindowsCamera','Microsoft.WindowsCalculator'
- )
- # 2d) Cortana (both OSes) – remove app + disable toggle
- $CortanaPkgName = 'Microsoft.549981C3F5F10'
- # Build the final removal list based on OS
- $RemoveNames = @()
- $RemoveNames += $CommonRemove
- if ($IsWin11) { $RemoveNames += $Win11Only } else { $RemoveNames += $Win10Only }
- $RemoveNames = $RemoveNames | Where-Object { -not (Test-IsKept $_) } | Select-Object -Unique
- # =========================
- # 3) Removal helper
- # =========================
- function Remove-AppxEverywhere {
- param([string]$Name)
- if (Test-IsKept $Name) {
- Write-Host "SKIP (kept): $Name" -ForegroundColor Yellow
- return
- }
- Write-Host "→ $Name" -ForegroundColor Gray
- # Current user
- $u = Get-AppxPackage -Name $Name
- if ($u) { $u | Remove-AppxPackage }
- # All users
- $a = Get-AppxPackage -AllUsers -Name $Name
- if ($a) { $a | Remove-AppxPackage -AllUsers }
- # Deprovision for new users
- $p = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $Name }
- if ($p) {
- $p | ForEach-Object { Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName | Out-Null }
- }
- }
- # =========================
- # 4) Remove packages
- # =========================
- Write-Host "`n-- Removing selected apps for $OsName (skips if missing) --" -ForegroundColor Cyan
- $RemoveNames | ForEach-Object { Remove-AppxEverywhere -Name $_ }
- # Cortana (both)
- Write-Host "→ Cortana (app + policy)" -ForegroundColor Gray
- Get-AppxPackage -AllUsers | Where-Object { $_.Name -eq $CortanaPkgName } | Remove-AppxPackage
- Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $CortanaPkgName } | Remove-AppxProvisionedPackage -Online | Out-Null
- # Disable Cortana + Bing web search
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v BingSearchEnabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v CortanaConsent /t REG_DWORD /d 0 /f | Out-Null
- # =========================
- # 5) Telemetry / Ads / Suggestions (reversible)
- # =========================
- Write-Host "`n-- Trimming telemetry & ads --" -ForegroundColor Cyan
- # Services (safe)
- Stop-Service DiagTrack -Force
- Set-Service DiagTrack -StartupType Disabled
- Stop-Service dmwappushservice -Force
- Set-Service dmwappushservice -StartupType Disabled
- # Scheduled tasks (safe to disable)
- $tasks = @(
- '\Microsoft\Windows\Application Experience\ProgramDataUpdater',
- '\Microsoft\Windows\Customer Experience Improvement Program\Consolidator',
- '\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask',
- '\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip',
- '\Microsoft\Windows\Feedback\Siuf\DmClient',
- '\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload',
- '\Microsoft\Windows\Maps\MapsUpdateTask',
- '\Microsoft\Windows\Windows Error Reporting\QueueReporting'
- )
- foreach ($t in $tasks) {
- try {
- Disable-ScheduledTask -TaskPath ($t.Substring(0,$t.LastIndexOf('\')+1)) `
- -TaskName ($t.Split('\')[-1])
- } catch {}
- }
- # Ads/tips/suggestions (per-user)
- $cdm = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
- New-Item -Path $cdm -Force | Out-Null
- $flags = @{
- 'ContentDeliveryAllowed' = 0
- 'OemPreInstalledAppsEnabled' = 0
- 'PreInstalledAppsEnabled' = 0
- 'PreInstalledAppsEverEnabled' = 0
- 'SilentInstalledAppsEnabled' = 0
- 'SystemPaneSuggestionsEnabled' = 0
- 'SoftLandingEnabled' = 0
- 'SubscribedContent-310093Enabled' = 0
- 'SubscribedContent-338387Enabled' = 0
- 'SubscribedContent-338388Enabled' = 0
- 'SubscribedContent-338389Enabled' = 0
- 'SubscribedContent-353694Enabled' = 0
- 'SubscribedContent-353696Enabled' = 0
- }
- foreach ($k in $flags.Keys) { Set-ItemProperty -Path $cdm -Name $k -Value $flags[$k] -Type DWord -Force }
- # Explorer & Settings suggestions (per-user)
- New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Force | Out-Null
- Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'ShowSyncProviderNotifications' -Value 0 -Type DWord -Force
- New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\Accounts' -Force | Out-Null
- Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\Accounts' -Name 'EnablePromotionalFeatures' -Value 0 -Type DWord -Force
- # =========================
- # A) Helper: detect NonRemovable packages and skip removal
- # =========================
- function Remove-AppxEverywhere {
- param([string]$Name)
- if (Test-IsKept $Name) {
- Write-Host "SKIP (kept): $Name" -ForegroundColor Yellow
- return
- }
- # If any installed instance is marked NonRemovable, skip uninstall and fall back to "disable" path.
- $any = @(Get-AppxPackage -AllUsers -Name $Name)
- $isNonRemovable = $false
- if ($any.Count -gt 0) {
- # Query the first instance for NonRemovable; if true, treat as non-removable.
- $isNonRemovable = ($any | Where-Object { $_.NonRemovable -eq $true }).Count -gt 0
- }
- if ($isNonRemovable) {
- Write-Host "→ $Name is NonRemovable (system app). Skipping uninstall and applying disable tweaks." -ForegroundColor Yellow
- if ($Name -eq 'Microsoft.XboxGameCallableUI') {
- Disable-XboxOverlay
- }
- return
- }
- Write-Host "→ $Name" -ForegroundColor Gray
- # Current user
- $u = Get-AppxPackage -Name $Name
- if ($u) { $u | Remove-AppxPackage }
- # All users
- $a = Get-AppxPackage -AllUsers -Name $Name
- if ($a) { $a | Remove-AppxPackage -AllUsers }
- # Deprovision for new users
- $p = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $Name }
- if ($p) {
- $p | ForEach-Object { Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName | Out-Null }
- }
- }
- # =========================
- # B) Disable function: Xbox Game Bar / overlay / DVR / services
- # =========================
- function Disable-XboxOverlay {
- Write-Host " - Disabling Xbox Game Bar / Game DVR / services" -ForegroundColor Gray
- # Policy: disable Game DVR system-wide
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v AllowGameDVR /t REG_DWORD /d 0 /f | Out-Null
- # Per-user switches
- reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v ShowStartupPanel /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v UseNexusForGameBarEnabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\System\GameConfigStore" /v GameDVR_Enabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\System\GameConfigStore" /v GameDVR_FSEBehaviorMode /t REG_DWORD /d 2 /f | Out-Null
- reg add "HKCU\System\GameConfigStore" /v GameDVR_HonorUserFSEBehaviorMode /t REG_DWORD /d 1 /f | Out-Null
- reg add "HKCU\System\GameConfigStore" /v GameDVR_DXGIHonorFSEWindowsCompatible /t REG_DWORD /d 1 /f | Out-Null
- reg add "HKCU\System\GameConfigStore" /v GameDVR_EFSEFeatureFlags /t REG_DWORD /d 0 /f | Out-Null
- # Related services
- $svc = @('XblAuthManager','XblGameSave','XboxNetApiSvc')
- foreach ($s in $svc) {
- Stop-Service $s -ErrorAction SilentlyContinue
- Set-Service $s -StartupType Disabled -ErrorAction SilentlyContinue
- }
- }
- # =========================
- # C) Verify section: ignore known NonRemovable packages
- # =========================
- $KnownNonRemovable = @('Microsoft.XboxGameCallableUI')
- Write-Host "`n-- Verify removed packages (ignores NonRemovable) --" -ForegroundColor Cyan
- $RemoveNames |
- Where-Object { $KnownNonRemovable -notcontains $_ } |
- ForEach-Object { Get-AppxPackage -AllUsers -Name $_ }
- # =========================
- # 6) Verify quickly
- # =========================
- Write-Host "`n-- Verify removed packages (should return nothing) --" -ForegroundColor Cyan
- $RemoveNames | ForEach-Object { Get-AppxPackage -AllUsers -Name $_ }
- # Start Menu Experience Host
- Get-AppxPackage -AllUsers Microsoft.Windows.StartMenuExperienceHost |
- ForEach-Object {
- Add-AppxPackage -Register -DisableDevelopmentMode "$($_.InstallLocation)\AppXManifest.xml"
- }
- # Shell Experience Host (taskbar/start glue)
- Get-AppxPackage -AllUsers Microsoft.Windows.ShellExperienceHost |
- ForEach-Object {
- Add-AppxPackage -Register -DisableDevelopmentMode "$($_.InstallLocation)\AppXManifest.xml"
- }
- # Search components (hits Win10/Win11 variants)
- Get-AppxPackage -AllUsers *Search* |
- ForEach-Object {
- if (Test-Path "$($_.InstallLocation)\AppXManifest.xml") {
- Add-AppxPackage -Register -DisableDevelopmentMode "$($_.InstallLocation)\AppXManifest.xml"
- }
- }
- # === Apps-first Start search (Win10/Win11) ===
- # 1) Make sure Windows Search runs
- Set-Service WSearch -StartupType Automatic
- Start-Service WSearch
- # 2) Kill web results in Start
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v BingSearchEnabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v ConnectedSearchUseWeb /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f | Out-Null
- # Older Win10 builds also honor this Explorer policy:
- reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f | Out-Null
- # 3) Disable cloud/graph (M365/OneDrive) content in search
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCloudSearch /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v IsAADCloudSearchEnabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v IsMSACloudSearchEnabled /t REG_DWORD /d 0 /f | Out-Null
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v IsDeviceSearchHistoryEnabled /t REG_DWORD /d 0 /f | Out-Null
- # 4) Use "Classic" indexing (don’t crawl entire PC)
- # 0 = Classic, 1 = Enhanced
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v EnableFindMyFiles /t REG_DWORD /d 0 /f | Out-Null
- # 5) Restart the search service and rebuild the (smaller) index
- Stop-Service WSearch -Force
- $SearchData = "$env:PROGRAMDATA\Microsoft\Search\Data\Applications\Windows"
- Remove-Item "$SearchData\Windows.edb" -Force -ErrorAction SilentlyContinue
- Start-Service WSearch
- Write-Host "`nDone. Give Start search a minute to rebuild the smaller index." -ForegroundColor Green
- Write-Host "`nDone. Reboot recommended." -ForegroundColor Green
Advertisement
Add Comment
Please, Sign In to add comment