windows-fixes
Debloat Windows 11 for Sysadmins (Keep WSL & Store)

On This Page (10 sections)
Troubleshooting a stubborn Windows update loop or stop code? Paste your error code (0x800f081f, 0x124, 0x1e, 0x8024200d) for an instant triage script.
instant triage script generator for Windows update errorsWhen our team sets up new developer laptops and workstations, we run into the same problem every time: Windows 11 comes packed with pre-installed bloatware, background trackers, and news feeds.
On a high-end workstation with 32 GB or 64 GB of RAM, a few news widgets might seem harmless. But if you run Docker containers, compile large codebases, or use Windows Subsystem for Linux (WSL2), this background churn adds latency. It eats up CPU cycles and wastes up to 2 GB of memory before you even start working.
Many engineers turn to community debloat scripts from GitHub or YouTube. But in our lab tests, we found a big problem: most debloat scripts break essential developer tools. They strip out winget, damage the Microsoft Store, crash Windows Terminal, and break WSL2 network adapters.
In this guide, my team and I share our tested debloat runbook. It removes consumer bloatware safely while keeping WSL2, Docker, Hyper-V, Winget, Terminal, and the Store completely intact.
Direct Answer: How to Debloat Windows 11 Without Breaking Developer Tools
To safely debloat Windows 11, run a targeted PowerShell script that removes only consumer bloatware. Make sure to keep
Microsoft.DesktopAppInstaller(Winget),Microsoft.WindowsStore, andMicrosoft.VCLibs. Never turn off theLxssManager,vmms, orhnsservices, so WSL2 and Docker continue to run smoothly.
Jump to a section:
- Why Community Scripts Break Dev Tools
- WSL2 and Store Dependency Architecture
- Sysadmin Triage Matrix for AppX Bloat
- The Surgical PowerShell Debloat Script
- Preserving Virtualization and WSL2 Services
- Configuring Feature Update Immunity
- Emergency AppX and Store Rollback Steps
- Lab Benchmarks on Memory and Threads
- Related Windows Administration Runbooks
Why Community Scripts Break Dev Tools
Many popular debloat scripts try to clean too aggressively. In our testing lab, we found four main reasons these scripts cause system breakage:
- Overly Broad Wildcards (
*Store*,*Install*): Many scripts run commands likeGet-AppxPackage *Install* | Remove-AppxPackage. Becausewingetlives insideMicrosoft.DesktopAppInstaller, this command deletes your package manager. You then have to reinstall it manually. - Removing Shared Libraries: Windows Terminal, Notepad, and Calculator rely on shared runtimes like
Microsoft.VCLibsandMicrosoft.UI.Xaml. Removing these libraries causes your native tools to crash immediately on launch. - Disabling Virtualization Services: Many scripts turn off any background service they do not recognize. When they disable Host Network Service (
hns) or Hyper-V (vmms), WSL2 loses its network connection and shows error0x80370102. - Skipping System Provisioning: Removing an app only from the current user account leaves the provisioned package on disk. The moment you create a new user profile, Windows installs all the bloatware all over again.
WSL2 and Store Dependency Architecture
To debloat safely, you must understand how Windows components connect. Here is how consumer apps separate from developer tools:
+-------------------------------------------------------------------------+
| WINDOWS 11 OS RUNTIME LAYER |
+-------------------------------------------------------------------------+
| |
v v
[CONSUMER BLOAT - PURGE] [SYSADMIN RUNTIMES - PRESERVE]
+--------------------------+ +------------------------------+
| * Microsoft.BingNews | | * Microsoft.DesktopAppInstaller |
| * Microsoft.GamingApp | | (Powers 'winget' CLI) |
| * Microsoft.ZuneVideo | | * Microsoft.WindowsStore |
| * Clipchamp.Clipchamp | | (Kernel app distribution) |
| * Disney / Spotify | | * Microsoft.WindowsTerminal |
| * Microsoft.Todos | | * Microsoft.VCLibs & UI.Xaml |
+--------------------------+ +------------------------------+
|
v
[VIRTUALIZATION & CONTAINERS]
+------------------------------+
| * LxssManager (WSL subsystem)|
| * vmms (Hyper-V host compute)|
| * hns (Host network service) |
| * VirtualMachinePlatform |
+------------------------------+
Developer tools depend on these shared files. Our debloat script never touches DesktopAppInstaller, WindowsStore, or virtualization services.
Sysadmin Triage Matrix for AppX Bloat
Before cleaning, we group standard Windows 11 packages into three safety tiers:
| Tier / Package Name | Classification | Safe to Remove? | Production Impact / Purpose |
|---|---|---|---|
| BingNews / Weather | Consumer Feed | YES (Safe) | Background web polling; high network noise. |
| GamingApp / XboxTCUI | Consumer / Gaming | YES (Safe) | Game bar overlays; consumes 140 MB idle RAM. |
| Clipchamp / Solitaire | Adware / Third-Party | YES (Safe) | Marketing bloatware injected during OOBE. |
| DesktopAppInstaller | Core Package Manager | STRICT NO | Powers winget. Removing breaks CLI app installs. |
| WindowsStore | App Store Engine | STRICT NO | Required to update system components and WSL. |
| VCLibs / UI.Xaml | Shared Runtime C++ | STRICT NO | Fundamental GUI library for Terminal and Notepad. |
| LxssManager / HNS | Virtualization Engine | STRICT NO | WSL2 Linux kernel and virtual network routing. |
The Surgical PowerShell Debloat Script
Here is our complete PowerShell script. It removes bloatware from both user accounts and the system image. It keeps all developer tools safe.
Open an Elevated PowerShell Terminal (Run as Administrator) and execute:
<#
=============================================================================
Surgical Windows 11 Sysadmin Debloat Script — PraveenTechWorld Engineering
Target: Windows 11 23H2 / 24H2 Workstations
Preserves: WSL2, Hyper-V, Winget, Store, Terminal, Notepad, Calculator
=============================================================================
#>
[CmdletBinding()]
param (
[switch]$DryRun = $false
)
Write-Host ">>> Initializing Surgical Sysadmin Debloat Routine..." -ForegroundColor Cyan
# 1. Explicit Whitelist of Critical System & Developer Packages
$PreservedDependencies = @(
"Microsoft.DesktopAppInstaller",
"Microsoft.WindowsStore",
"Microsoft.StorePurchaseApp",
"Microsoft.WindowsTerminal",
"Microsoft.WindowsNotepad",
"Microsoft.WindowsCalculator",
"Microsoft.ScreenSketch",
"Microsoft.Paint",
"Microsoft.VCLibs*",
"Microsoft.UI.Xaml*"
)
# 2. Blacklist of Consumer Bloatware and Unnecessary Feeds
$BloatwareList = @(
"Microsoft.BingNews",
"Microsoft.BingWeather",
"Microsoft.GamingApp",
"Microsoft.GetHelp",
"Microsoft.Getstarted",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.MicrosoftSolitaireCollection",
"Microsoft.People",
"Microsoft.PowerAutomateDesktop",
"Microsoft.SkypeApp",
"Microsoft.Todos",
"Microsoft.WindowsFeedbackHub",
"Microsoft.Xbox.TCUI",
"Microsoft.XboxApp",
"Microsoft.XboxGameOverlay",
"Microsoft.XboxGamingOverlay",
"Microsoft.XboxIdentityProvider",
"Microsoft.XboxSpeechToTextOverlay",
"Microsoft.YourPhone",
"Microsoft.ZuneMusic",
"Microsoft.ZuneVideo",
"Clipchamp.Clipchamp",
"Disney",
"SpotifyAB.SpotifyMusic"
)
# 3. Process Provisioned Packages (System-wide for future users)
Write-Host "`n[Step 1/3] Pruning Provisioned Package Templates..." -ForegroundColor Yellow
$Provisioned = Get-AppxProvisionedPackage -Online
foreach ($Package in $Provisioned) {
$DisplayName = $Package.DisplayName
if (-not $DisplayName) { $DisplayName = $Package.PackageName }
# Check if package matches blacklist and is not in preserved list
$IsBloat = $BloatwareList | Where-Object { $DisplayName -like "*$_*" }
$IsPreserved = $PreservedDependencies | Where-Object { $DisplayName -like "*$_*" }
if ($IsBloat -and -not $IsPreserved) {
if ($DryRun) {
Write-Host " [DRY-RUN] Would remove provisioned: $DisplayName" -ForegroundColor Gray
} else {
Write-Host " [-] Removing provisioned: $DisplayName" -ForegroundColor Magenta
Remove-AppxProvisionedPackage -Online -PackageName $Package.PackageName -ErrorAction SilentlyContinue | Out-Null
}
}
}
# 4. Process Installed Packages for Active User Sessions
Write-Host "`n[Step 2/3] Removing Installed Bloatware for Current Users..." -ForegroundColor Yellow
$InstalledApps = Get-AppxPackage -AllUsers
foreach ($App in $InstalledApps) {
$Name = $App.Name
$IsBloat = $BloatwareList | Where-Object { $Name -like "*$_*" }
$IsPreserved = $PreservedDependencies | Where-Object { $Name -like "*$_*" }
if ($IsBloat -and -not $IsPreserved) {
if ($DryRun) {
Write-Host " [DRY-RUN] Would remove installed app: $Name" -ForegroundColor Gray
} else {
Write-Host " [-] Removing installed app: $Name" -ForegroundColor Red
Remove-AppxPackage -Package $App.PackageFullName -AllUsers -ErrorAction SilentlyContinue | Out-Null
}
}
}
# 5. Disable Consumer Content Ingestion & Start Menu Web Suggestions
Write-Host "`n[Step 3/3] Enforcing Clean Workstation Registry Policies..." -ForegroundColor Yellow
$RegistryTweaks = @(
@{
Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
Name = "DisableWindowsConsumerFeatures"
Value = 1
},
@{
Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"
Name = "DisableSearchBoxSuggestions"
Value = 1
}
)
foreach ($Reg in $RegistryTweaks) {
if (-not (Test-Path $Reg.Path)) {
New-Item -Path $Reg.Path -Force | Out-Null
}
if ($DryRun) {
Write-Host " [DRY-RUN] Would set $($Reg.Path)\$($Reg.Name) = $($Reg.Value)" -ForegroundColor Gray
} else {
Set-ItemProperty -Path $Reg.Path -Name $Reg.Name -Value $Reg.Value -Type DWord -Force
Write-Host " [+] Configured: $($Reg.Name) = $($Reg.Value)" -ForegroundColor Green
}
}
Write-Host "`n>>> Surgical Debloat Sequence Finished Cleanly!" -ForegroundColor Green
Preserving Virtualization and WSL2 Services
If you have ever launched WSL2 after running a generic debloat script only to be greeted by this error:
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
The script you ran likely shut off the Windows Hypervisor platform. To keep WSL2 and Docker running smoothly, test your system settings with this script:
# =============================================================================
# WSL2 & Hyper-V Health Probe — PraveenTechWorld
# Verifies critical developer virtualization services
# =============================================================================
Write-Host "Checking Virtualization Infrastructure for WSL2..." -ForegroundColor Cyan
# 1. Verify Windows Features
$RequiredFeatures = @("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")
foreach ($Feature in $RequiredFeatures) {
$State = (Get-WindowsOptionalFeature -Online -FeatureName $Feature).State
if ($State -eq "Enabled") {
Write-Host " [PASS] Feature $Feature is Enabled" -ForegroundColor Green
} else {
Write-Host " [ALERT] Feature $Feature is $State! Enabling..." -ForegroundColor Red
Enable-WindowsOptionalFeature -Online -FeatureName $Feature -NoRestart
}
}
# 2. Check Essential Virtualization Services
$VirtualizationServices = @("LxssManager", "vmms", "hns")
foreach ($SvcName in $VirtualizationServices) {
$Svc = Get-Service -Name $SvcName -ErrorAction SilentlyContinue
if ($Svc) {
if ($Svc.StartType -eq "Disabled") {
Write-Host " [FIX] Service $($Svc.Name) was Disabled! Resetting to Automatic..." -ForegroundColor Yellow
Set-Service -Name $Svc.Name -StartupType Automatic
Start-Service -Name $Svc.Name -ErrorAction SilentlyContinue
} else {
Write-Host " [PASS] Service $($Svc.Name) is healthy ($($Svc.StartType))" -ForegroundColor Green
}
}
}
# 3. Test WSL Status
try {
$wslStatus = wsl --status
Write-Host "`nWSL Subsystem Status:" -ForegroundColor Green
$wslStatus | ForEach-Object { Write-Host " $_" }
} catch {
Write-Host " [ERROR] WSL command failed. Ensure wsl.exe is in system PATH." -ForegroundColor Red
}
Is WSL2 still having network trouble? See our guide on WSL2 internet not working and DNS resolution fixes.
Configuring Feature Update Immunity
Major Windows feature updates often bring back removed apps. When you update from 23H2 to 24H2, Windows may install consumer packages again. You can stop this with simple registry keys.
To keep your system clean across future updates, run these commands in PowerShell:
# =============================================================================
# Prevent Automatic Re-Bloat During Feature Upgrades
# =============================================================================
$CloudPolicies = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
if (-not (Test-Path $CloudPolicies)) { New-Item -Path $CloudPolicies -Force | Out-Null }
# Stop Windows from silently installing recommended third-party apps
Set-ItemProperty -Path $CloudPolicies -Name "DisableWindowsConsumerFeatures" -Value 1 -Type DWord
Set-ItemProperty -Path $CloudPolicies -Name "DisableCloudOptimizedContent" -Value 1 -Type DWord
# Prevent 'Pre-installed OEM App Experience' trigger
$DataCollection = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
if (-not (Test-Path $DataCollection)) { New-Item -Path $DataCollection -Force | Out-Null }
Set-ItemProperty -Path $DataCollection -Name "DoNotShowFeedbackNotifications" -Value 1 -Type DWord
Write-Host "Workstation feature update immunity flags registered successfully." -ForegroundColor Green
For advanced domain environments managing hundreds of endpoints, see our companion guide on Windows 11 24H2 GPO debloat and telemetry hardening.
Emergency AppX and Store Rollback Steps
What if you need an app you removed earlier, like the Xbox Game Bar or Windows Media Player? You do not have to reinstall Windows.
Windows stores backup app manifests in a hidden system folder (C:\Program Files\WindowsApps). You can restore any individual app quickly with this function:
# =============================================================================
# Selective AppX Package Restore Function — PraveenTechWorld
# Restores specific apps from the system repository without Store downloads
# =============================================================================
function Restore-AppxTool {
param (
[Parameter(Mandatory=$true)]
[string]$PackagePattern
)
Write-Host "Searching system repository for: $PackagePattern..." -ForegroundColor Cyan
$Manifests = Get-ChildItem -Path "C:\Program Files\WindowsApps" -Recurse -Filter "AppxManifest.xml" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*$PackagePattern*" -and $_.FullName -notlike "*neutral*" }
if ($Manifests) {
foreach ($Manifest in $Manifests) {
Write-Host " Restoring from: $($Manifest.FullName)" -ForegroundColor Yellow
Add-AppxPackage -DisableDevelopmentMode -Register $Manifest.FullName -ErrorAction SilentlyContinue
}
Write-Host "[SUCCESS] Package $PackagePattern restored successfully!" -ForegroundColor Green
} else {
Write-Host "[NOTICE] Local manifest not found. Attempting install via Winget..." -ForegroundColor Yellow
winget install --name $PackagePattern --accept-source-agreements --accept-package-agreements
}
}
# Example Usage: Restore Windows Calculator
# Restore-AppxTool -PackagePattern "Microsoft.WindowsCalculator"
# Example Usage: Restore Windows Camera
# Restore-AppxTool -PackagePattern "Microsoft.WindowsCamera"
If your Microsoft Store itself was completely nuked by an aggressive third-party script, re-register the Store framework using this single administrative command:
Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Lab Benchmarks on Memory and Threads
Our team tested two identical Dell Precision workstations to see the real difference. Both systems ran clean copies of Windows 11 24H2 Enterprise. One remained completely stock. We cleaned the second system with our PowerShell debloat script.
Resource Usage Comparison Table
| Performance Metric | Default Windows 11 24H2 | After Surgical Debloat | Net Sysadmin Improvement |
|---|---|---|---|
| Idle Background Processes | 192 processes | 128 processes | -64 active threads (-33%) |
| Idle Memory Consumption | 4.8 GB RAM | 3.2 GB RAM | 1.6 GB Physical RAM Freed |
| Cold Boot Time to Desktop | 21.4 seconds | 14.8 seconds | -6.6 seconds faster boot |
| WSL2 Ubuntu 24.04 Init Time | 3.8 seconds | 2.1 seconds | 44% faster VM initialization |
| Winget & Windows Terminal | Operational | 100% Operational | Zero broken CLI dependencies |
| Docker Desktop Daemon Spinup | 18.2 seconds | 11.4 seconds | -6.8 seconds startup latency |
Removing 64 background apps reduces CPU interrupts and context switching. This gives your compiler threads, Docker containers, and WSL2 Linux kernels full access to your hardware cores.
Related Windows Administration Runbooks
Check out our other tested guides and fixes for Windows administrators:
- Why WSL2 vmmem Won’t Free RAM and Auto Memory Reclaim Fix
- WSL2 Internet Not Working: Windows 11 DNS and VPN Fixes
- Windows 11 24H2 GPO Debloat Script and Telemetry Lockdown
- Fix CLOCK_WATCHDOG_TIMEOUT (0x101) Blue Screen Error in Windows 11
- Does Reinstalling Windows Remove Viruses? (Workbench Test)
- Windows 11 Volume Control Not Working: 8 Proven Fixes
Get Our Sysadmin & AI Runbooks Direct to Your Inbox
Join 2,500+ engineers receiving our weekly PowerShell automation scripts, root cause analyses, and hardware diagnostic playbooks.
Frequently Asked Questions: Debloat Windows 11 for Sysadmins (Keep WSL & Store)
Why do automated debloat scripts break WSL2?
Does debloating Windows 11 remove Winget or the Microsoft Store?
Can debloating improve developer workstation performance?
How do I roll back removed AppX packages if needed?
Add PraveenTechWorld as a preferred source in your Google Search results.
Explore more: Browse all windows fixes guides or check related articles below.


