1769624158
This commit is contained in:
@@ -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
|
# Check for administrator privileges
|
||||||
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||||
# Restart with elevated privileges
|
# Restart with elevated privileges
|
||||||
@@ -22,8 +29,8 @@ sfc /scannow # cmd system file checker, retreives and replaces bad system files
|
|||||||
Write-Host "RUNNING DISM"
|
Write-Host "RUNNING DISM"
|
||||||
DISM /Online /Cleanup-Image /RestoreHealth # powershell checks image and replaces bad files
|
DISM /Online /Cleanup-Image /RestoreHealth # powershell checks image and replaces bad files
|
||||||
|
|
||||||
Write-Host "SCHEDULING OFFLINE CHECK DISK OF C: (chkdsk)"
|
Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (chkdsk)"
|
||||||
echo y | chkdsk /r C: # cmd checks C drive after reboot to waste time and fix errors
|
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"
|
Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN"
|
||||||
Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot
|
Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot
|
||||||
|
|||||||
Reference in New Issue
Block a user