Files
winutil/functions/public/Invoke-WPFSystemRepair.ps1
T

20 lines
821 B
PowerShell
Raw Normal View History

2025-05-05 17:20:20 +02:00
function Invoke-WPFSystemRepair {
<#
.SYNOPSIS
2026-02-17 20:55:51 +02:00
Checks for system corruption using SFC, and DISM
Checks for disk failure using Chkdsk
2025-05-05 17:20:20 +02:00
.DESCRIPTION
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
2025-05-05 17:20:20 +02:00
#>
Start-Process cmd.exe -ArgumentList "/c chkdsk /scan /perf" -NoNewWindow -Wait
2026-02-17 20:55:51 +02:00
Start-Process cmd.exe -ArgumentList "/c sfc /scannow" -NoNewWindow -Wait
Start-Process cmd.exe -ArgumentList "/c dism /online /cleanup-image /restorehealth" -NoNewWindow -Wait
2025-05-05 17:20:20 +02:00
2026-02-17 20:55:51 +02:00
Write-Host "==> Finished System Repair"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
2025-05-05 10:56:32 -05:00
}