Files
winutil/docs/content/dev/features/Fixes/DISM.md
T

27 lines
988 B
Markdown
Raw Normal View History

2026-02-10 19:49:36 +00:00
---
2026-04-17 09:04:35 -05:00
title: "System Corruption Scan - Run"
2026-02-10 19:49:36 +00:00
description: ""
---
2026-02-18 12:37:09 -06:00
```powershell {filename="functions/public/Invoke-WPFSystemRepair.ps1",linenos=inline,linenostart=1}
2026-01-14 20:28:45 +02:00
function Invoke-WPFSystemRepair {
<#
.SYNOPSIS
2026-02-18 12:37:09 -06:00
Checks for system corruption using SFC, and DISM
2026-02-23 18:28:56 -06:00
Checks for disk failure using Chkdsk
2026-01-14 20:28:45 +02:00
.DESCRIPTION
2026-02-23 18:28:56 -06:00
1. Chkdsk - Checks for disk errors, which can cause system file corruption and notifies of early disk failure
2. SFC - scans protected system files for corruption and fixes them
3. DISM - Repair a corrupted Windows operating system image
2026-01-14 20:28:45 +02:00
#>
2026-02-23 18:28:56 -06:00
Start-Process cmd.exe -ArgumentList "/c chkdsk /scan /perf" -NoNewWindow -Wait
2026-02-18 12:37:09 -06:00
Start-Process cmd.exe -ArgumentList "/c sfc /scannow" -NoNewWindow -Wait
Start-Process cmd.exe -ArgumentList "/c dism /online /cleanup-image /restorehealth" -NoNewWindow -Wait
2026-01-14 20:28:45 +02:00
2026-02-18 12:37:09 -06:00
Write-Host "==> Finished System Repair"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
2026-01-14 20:28:45 +02:00
}
```