Windows 11 Guide

How to Automate Windows 11 Post-Install Cleanup Using PowerShell

A fresh Windows 11 installation often includes optional apps, startup entries, old package versions, and settings you may not need. PowerShell can speed up the cleanup, but an aggressive “debloat” script can also remove Microsoft Store dependencies, break updates, or make future troubleshooting harder. This guide shows a cautious workflow: audit first, remove only what you recognise, log every change, and keep recovery options ready.

Difficulty: Beginner–IntermediateTime: 25–60 minutesUpdated: July 17, 2026

A fresh Windows 11 installation often includes optional apps, startup entries, old package versions, and settings you may not need. PowerShell can speed up the cleanup, but an aggressive “debloat” script can also remove Microsoft Store dependencies, break updates, or make future troubleshooting harder. This guide shows a cautious workflow: audit first, remove only what you recognise, log every change, and keep recovery options ready.

Quick answer

Start with the least invasive fix, test the result, and move to the next method only when the problem remains. Back up important files and recovery keys before reset, firmware, registry, encryption, or administrator-level changes.

On this page

Before you run any cleanup script

Do not begin by downloading a random script and running it as Administrator. First finish Windows Update, install the laptop or motherboard manufacturer’s drivers, confirm that audio, Wi-Fi, Bluetooth, graphics, sleep, and Windows Security work, and then create a restore point. Automation should be the final tidy-up step—not the first thing performed on an unstable installation.

Important: Keep Microsoft Defender, Windows Update, Microsoft Store, App Installer, Windows Terminal, Edge WebView2, and core framework packages unless you understand the dependency impact.

Step 1: Open PowerShell safely

  1. Right-click Start and choose Terminal (Admin).
  2. Approve the User Account Control prompt.
  3. Create a working folder for logs and scripts:
New-Item -ItemType Directory -Path "$env:USERPROFILE\Desktop\Win11-Cleanup" -Force
Set-Location "$env:USERPROFILE\Desktop\Win11-Cleanup"

Keeping the script and its logs in one folder makes it easier to review what happened or reverse a decision later.

Step 2: Export an inventory before removing anything

Generate lists of installed Store packages, traditional desktop programs, and startup entries. These reports are more useful than relying on memory.

Get-AppxPackage |
  Select-Object Name, PackageFullName |
  Sort-Object Name |
  Export-Csv ".\appx-packages.csv" -NoTypeInformation

Get-CimInstance Win32_StartupCommand |
  Select-Object Name, Command, Location, User |
  Export-Csv ".\startup-items.csv" -NoTypeInformation

winget list > ".\winget-installed-apps.txt"

Open the exported files and mark only apps you definitely do not use. A package name that looks unfamiliar is not automatically bloat.

Step 3: Remove optional Store apps one at a time

Search for the exact package before removal. Replace the example keyword with the app you want to inspect.

Get-AppxPackage *Clipchamp* |
  Select-Object Name, PackageFullName

When the result clearly matches the optional app, remove it for the current user:

Get-AppxPackage *Clipchamp* | Remove-AppxPackage

Do not use a broad command that pipes every Appx package into Remove-AppxPackage. That approach can remove components used by Settings, Store-delivered system apps, codecs, widgets, and sign-in experiences.

Step 4: Use Winget for normal desktop applications

Winget is usually cleaner for software installed through an installer. First search for the exact package ID:

winget list
winget search "App Name"

Then uninstall with the exact ID:

winget uninstall --id Vendor.AppName --exact

Using an exact ID reduces the risk of removing a similarly named program.

Step 5: Update installed applications

After removing unwanted software, update supported packages:

winget upgrade --all --include-unknown

Review the list before accepting prompts. Drivers, firmware utilities, VPN clients, security software, and development tools may require a manual update or restart.

Step 6: Audit startup apps instead of disabling services

The safest performance win is usually reducing unnecessary startup programs. Open Task Manager → Startup apps and disable launchers, chat tools, game clients, and vendor utilities you do not need immediately after sign-in. Avoid blanket service-disabling scripts; services may be triggered only when required and can support updates, printing, Bluetooth, search, networking, or security.

Step 7: Build a small, readable cleanup script

A good script contains a short allow-list of packages you personally selected, writes a log, and continues safely if an app is not present.

$Log = "$PSScriptRoot\cleanup-log.txt"
$OptionalApps = @(
  "Clipchamp.Clipchamp"
)

"Cleanup started: $(Get-Date)" | Out-File $Log

foreach ($App in $OptionalApps) {
  $Packages = Get-AppxPackage -Name $App -ErrorAction SilentlyContinue
  if ($Packages) {
    $Packages | ForEach-Object {
      "Removing $($_.Name)" | Tee-Object -FilePath $Log -Append
      Remove-AppxPackage -Package $_.PackageFullName -ErrorAction Continue
    }
  } else {
    "$App not installed" | Tee-Object -FilePath $Log -Append
  }
}

"Cleanup finished: $(Get-Date)" | Out-File $Log -Append

Add apps only after confirming their exact package names in your inventory. Run the script, restart Windows, and test the Start menu, Settings, Store, Search, and Windows Update.

Useful post-install tasks that do not require debloating

How to reverse a cleanup change

For a removed Store app, open Microsoft Store and reinstall it. For desktop software, use the publisher’s installer or Winget. If a script changed several settings and you cannot identify the cause, use the restore point created before cleanup. When the installation itself is damaged, a Windows 11 Cloud download reset may be cleaner than repeatedly applying debloat scripts.

Frequently Asked Questions

Does debloating make Windows 11 much faster?

Removing heavy startup programs can improve sign-in time and background resource use. Removing a few small built-in apps usually has a limited effect compared with RAM capacity, SSD health, drivers, browser tabs, and startup load.

Is it safe to remove all Appx packages?

No. Windows uses Store-delivered packages for both optional apps and integrated experiences. Remove only packages you have identified and tested.

Should I disable Windows Defender or Windows Update?

No. Disabling security and update components creates more risk than performance benefit for most users.

Can I run the same script on every PC?

Only after reviewing it for that device. Manufacturer utilities, work accounts, accessibility tools, and hardware features vary between computers.

Official references

For platform-specific behavior and recovery options, compare this guide with the current documentation from the relevant official source.