Skip to main content

Repair-WindowsUpdate

Description

This script resets Windows Update settings and repairs system files to resolve common update errors. It clears outdated update caches, resets core services, and optionally repairs the Windows image.

warning

This script is provided without warranty and does not guarantee that all Windows Update issues will be resolved

Requirements

  • PowerShell 5.1 or later
  • Administrator privileges
  • Active internet connection
  • Valid Windows license

When to use it

Use this script when Windows Update fails to install, gets stuck checking for updates, or reports corrupted system files. It serves as a primary troubleshooting step for stubborn update errors.

Usage

Run the script to clear update caches and reset Windows Update services:

.\Repair-WindowsUpdate.ps1

Run the script and include a DISM repair to fix the underlying Windows image:

.\Repair-WindowsUpdate.ps1 -DismRepair

Run the script and include a System File Checker (SFC) scan to repair corrupted Windows files:

.\Repair-WindowsUpdate.ps1 -SfcScan

Run all repairs (DISM, SFC, and Windows Update reset) for a comprehensive fix. DISM runs first to ensure the component store is healthy:

.\Repair-WindowsUpdate.ps1 -DismRepair -SfcScan

Run only DISM and SFC repairs without resetting Windows Update settings:

.\Repair-WindowsUpdate.ps1 -DismRepair -SfcScan -SkipWUReset

Parameters

ParameterRequiredDefaultTypeDescription
-DismRepairNoFalseSwitchRepairs the Windows image using DISM. Runs before SFC.
-SfcScanNoFalseSwitchScans and repairs corrupted Windows system files.
-SkipWUResetNoFalseSwitchSkips the Windows Update reset and inventory pull. Use this to run only DISM and SFC.

Output

.\Repair-WindowsUpdate-log.txt
.\Repair-WindowsUpdate-error.txt

Changelog

2026-08-18

  • Added -SkipWUReset parameter to allow running only system repairs.
  • Added automatic cleanup of old update backup folders to prevent disk space bloat.
  • Improved repair order so DISM runs before SFC.
  • Updated logging to use the Strapper module.

2025-04-10

  • Initial version of the document.