A modern, zero-dependency Fluent Design desktop application for Windows 10 and Windows 11 that guides you through Windows Component Store (WinSxS) diagnostics, system file verification, and safe component cleanup—without touching a terminal or memorizing command-line switches.
Windows includes powerful built-in repair and maintenance utilities—DISM (Deployment Image Servicing and Management) and SFC (System File Checker)—but running them properly usually means opening an elevated Command Prompt, remembering exact flags (/Online /Cleanup-Image /ScanHealth, /RestoreHealth, /AnalyzeComponentStore, /StartComponentCleanup), and staring at a static text cursor wondering if the console froze.
Component Store Maintenance replaces that friction with an approachable, native-feeling Windows interface:
- No commands to memorize: Launch the app and click Start Maintenance. Everything runs in the proper sequence automatically.
- Smart, conditional execution: Instead of blindly running heavy repair or cleanup routines when your PC doesn't need them, it inspects your system first and only triggers
/RestoreHealthor/StartComponentCleanupif corruption or reclaimable packages are actually found. - Clear visual feedback: Real-time step cards, progress bars, elapsed timers, and an expandable live command output drawer show exactly what Windows is doing at every stage.
- Guided 3-Stage Maintenance Pipeline:
- Component Store Health (DISM): Runs
dism.exe /ScanHealthfirst, automatically transitioning to/RestoreHealthonly if component store corruption is detected. - System File Checker (SFC): Runs
sfc.exe /scannowto verify and repair protected Windows system files. - Component Store Cleanup (DISM): Runs
dism.exe /AnalyzeComponentStoreand executes/StartComponentCleanuponly when Windows reports that cleanup is recommended.
- Component Store Health (DISM): Runs
- Native Windows 10 & 11 Fluent Design: Built in pure WPF with Windows 11 Mica backdrop support, live Windows accent color matching, and an Auto / Light / Dark theme switcher.
- Automatic Elevation & STA Handling: Automatically requests Administrator privileges via UAC and safely spawns an STA thread if launched from an MTA host.
- Live Command Output & Log Export: Expand the output drawer anytime to inspect raw DISM/SFC output, copy it to your clipboard, or save a timestamped
.logfile. - Smart Restart Prompt: Alerts you with a one-click Restart PC button only when repairs were actually applied.
- Zero External Dependencies: Single self-contained
.ps1file compatible with both Windows PowerShell 5.1 and PowerShell 7.x.
Open PowerShell and run:
Install-Script -Name Repair-WindowsComponentStore -ForceOnce installed, you can launch it from any PowerShell prompt by running:
Repair-WindowsComponentStore.ps1To open the window and begin maintenance immediately without clicking Start Maintenance, pass -AutoStart:
Repair-WindowsComponentStore.ps1 -AutoStart- Download
Repair-WindowsComponentStore.ps1from the GitHub repository. - Save it to a permanent folder (for example,
C:\Scripts\Repair-WindowsComponentStore.ps1). - Right-click the file and select Run with PowerShell, or run it from a PowerShell terminal:
.\Repair-WindowsComponentStore.ps1Because PowerShell scripts open in Notepad by default when double-clicked, creating a desktop shortcut makes launching Component Store Maintenance feel like any other Windows app.
For the easiest setup with automatic icon extraction and execution policy handling, use PowerShell Desktop Shortcut Creator:
- Download or install PowerShell Desktop Shortcut Creator.
- Browse to
Repair-WindowsComponentStore.ps1(if installed via PowerShell Gallery, it is typically located inC:\Program Files\WindowsPowerShell\Scripts\orC:\Program Files\PowerShell\Scripts\). - Optionally add
-AutoStartin the arguments field if you want double-clicking the shortcut to start scanning immediately. - Click Create Shortcut.
Run the following snippet in PowerShell to locate Repair-WindowsComponentStore.ps1 and create a clean desktop shortcut (without a flashing console window):
$ScriptPath = (Get-Command Repair-WindowsComponentStore.ps1 -ErrorAction SilentlyContinue).Source
if (-not $ScriptPath) {
$ScriptPath = "C:\Scripts\Repair-WindowsComponentStore.ps1" # Update if saved manually elsewhere
}
$PsExe = if (Get-Command pwsh.exe -ErrorAction SilentlyContinue) {
(Get-Command pwsh.exe).Source
} else {
"$env:WINDIR\System32\WindowsPowerShell\v1.0\powershell.exe"
}
$DesktopPath = [Environment]::GetFolderPath("Desktop")
$ShortcutPath = Join-Path $DesktopPath "Component Store Maintenance.lnk"
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = $PsExe
# Add -AutoStart after `"$ScriptPath`" if you want maintenance to start immediately on launch
$Shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$ScriptPath`""
$Shortcut.WorkingDirectory = Split-Path $ScriptPath -Parent
$Shortcut.Description = "Scan, repair, and clean up the Windows Component Store (WinSxS)"
$Shortcut.IconLocation = "$env:WINDIR\System32\imageres.dll,102"
$Shortcut.Save()- DISM Progress Jumps Are Normal: During
/RestoreHealthand/StartComponentCleanup, Windows DISM commonly pauses at 20% or 70% for a couple of minutes before jumping straight to 100%. The app is still working—watch the elapsed timer in the top-right card to confirm activity. - Keep Your Internet Connection Active: If Step 1 detects component store corruption,
DISM /RestoreHealthdownloads clean replacement files from Windows Update by default. - Reboot When Prompted: If DISM or SFC repairs damaged system files, Windows stages pending file replacements that finish applying on the next reboot. Use the Restart PC button in the bottom bar when prompted.
- One-Click Routine Maintenance: Add
-AutoStartto your desktop shortcut arguments if you want a single double-click to launch, scan, repair, and clean up automatically.
If a startup error occurs before the WPF window renders, the script displays an error dialog and writes a full stack trace to:
%TEMP%\WinSxS-Maintenance-Error.log
Check that file for exact details if the window fails to open.
If running Repair-WindowsComponentStore.ps1 directly in PowerShell is blocked by your system's execution policy, allow locally installed and signed scripts for your user account:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThis happens when Windows Update cannot supply the repair files (for example, when offline, behind a strict WSUS policy, or on a mismatched build).
- Ensure you have an active internet connection and Windows Update is not paused or blocked.
- Alternatively, mount a matching Windows 10/11 ISO and run DISM manually pointing to its
sources\install.wimorinstall.esdfile, then re-run Component Store Maintenance.
If Step 2 completes with a Partial warning:
- Restart your computer so any repairs made by Step 1 (
DISM /RestoreHealth) finish committing. - Run Component Store Maintenance a second time—SFC can often repair remaining files once DISM has restored the underlying component store cache.
- If the warning persists, inspect
C:\Windows\Logs\CBS\CBS.logfor[SR] Cannot repair member fileentries.
Ensure your PowerShell Scripts directory is in your $env:PATH, or run the script using its full path:
- PowerShell 7:
$env:ProgramFiles\PowerShell\Scripts\Repair-WindowsComponentStore.ps1* Windows PowerShell 5.1:$env:ProgramFiles\WindowsPowerShell\Scripts\Repair-WindowsComponentStore.ps1
- Added explicit 100% completion snap and a 1.5-second cancellable transition state between
ScanHealth->RestoreHealth(Step 1a -> 1b) andAnalyzeComponentStore->StartComponentCleanup(Step 3a -> 3b). - Updated Hero and Step Card titles/badges to clearly indicate when analysis/scanning has finished and repair/cleanup is beginning.
- Fixed
Set-BrushResourceby updating existing XAMLSolidColorBrush.Colorin-place to prevent PowerShellPSObjectwrapping insideResourceDictionary.
- Fixed WPF
XamlReader.ParseControlTemplatestoryboard targeting onRenderTransform(which caused a silent crash on launch). - Added startup error dialog and
%TEMP%\WinSxS-Maintenance-Error.logfallback so errors never fail silently. - Removed unused
System.DrawingandSystem.Windows.Formsassembly loads.
- Replaced non-ASCII characters in strings with pure ASCII so PowerShell 5.1 parses cleanly even when saved as UTF-8 without BOM.
- Switched live Windows theme/accent change detection to an
HwndSourcemessage hook on the UI thread.
- Upgraded to a zero-dependency Fluent Design WPF application matching Windows 10/11 native styling.
- Initial console release.
Licensed under the MIT License — Copyright (c) 2026 Danny Wareham (waresoft / 2civics).