mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
* Update Invoke-WPFSystemRepair.ps1 * Update Invoke-WPFSystemRepair.ps1 * add chkdsk back in to tell users if there disk is broken * Merge branch 'Update-Invoke-WPFSystemRepair' of https://github.com/gabinun/winutil into pr/GabiNun/4043 * add doc
18 lines
815 B
PowerShell
18 lines
815 B
PowerShell
function Invoke-WPFSystemRepair {
|
|
<#
|
|
.SYNOPSIS
|
|
Checks for system corruption using SFC, and DISM
|
|
|
|
.DESCRIPTION
|
|
1. SFC - Fixes system file corruption, and fixes DISM if it was corrupted
|
|
2. DISM - Fixes system image corruption, and fixes SFC's system image if it was corrupted
|
|
3. Chkdsk - Checks for disk errors, which can cause system file corruption and notifies of early disk failure
|
|
#>
|
|
Start-Process cmd.exe -ArgumentList "/c chkdsk.exe /scan /perf" -NoNewWindow -Wait
|
|
Start-Process cmd.exe -ArgumentList "/c sfc /scannow" -NoNewWindow -Wait
|
|
Start-Process cmd.exe -ArgumentList "/c dism /online /cleanup-image /restorehealth" -NoNewWindow -Wait
|
|
|
|
Write-Host "==> Finished System Repair"
|
|
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
|
}
|