diff --git a/Windows-Scripts/windows-repair.ps1 b/Windows-Scripts/windows-repair.ps1 index 13f4b1f..eae8c09 100644 --- a/Windows-Scripts/windows-repair.ps1 +++ b/Windows-Scripts/windows-repair.ps1 @@ -1,6 +1,13 @@ +# Usage: +# Download to $env:USERPROFILE\Downloads (user's Downloads folder) +# https://raw.githubusercontent.com/human/Windows-Scripts/main/windows-repair.ps1 +# Open PowerShell as Administrator +# win+x +# alt+a +# alt+y +# Run: +# powershell.exe -ExecutionPolicy Bypass -File $env:USERPROFILE\Downloads\windows-repair.ps1 -# powershell.exe -ExecutionPolicy Bypass -File %ONEDRIVE%\Desktop\windows-repair.ps1" -# powershell.exe -ExecutionPolicy Bypass -File $env:ONEDRIVE\Desktop\windows-repair.ps1" # Check for administrator privileges if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { # Restart with elevated privileges @@ -22,8 +29,8 @@ sfc /scannow # cmd system file checker, retreives and replaces bad system files Write-Host "RUNNING DISM" DISM /Online /Cleanup-Image /RestoreHealth # powershell checks image and replaces bad files -Write-Host "SCHEDULING OFFLINE CHECK DISK OF C: (chkdsk)" -echo y | chkdsk /r C: # cmd checks C drive after reboot to waste time and fix errors +Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (chkdsk)" +Write-Host y | chkdsk /f /r C: # cmd checks C drive after reboot to waste time and fix errors (noninteractive) Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN" Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot