1781299558
This commit is contained in:
@@ -4,13 +4,11 @@
|
|||||||
# alt+a
|
# alt+a
|
||||||
# alt+y
|
# alt+y
|
||||||
# Run:
|
# Run:
|
||||||
# powershell.exe -ep bypass -NoProfile -c "iwr -Uri 'https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1' > "$env:TEMP\windows-repair.ps1"; powershell.exe -ep bypass -NoProfile -File "$env:TEMP\windows-repair.ps1"
|
# powershell.exe -ep bypass -NoProfile -c "iwr 'https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1' > "$env:TEMP\windows-repair.ps1"; powershell.exe -ep bypass -NoProfile -File "$env:TEMP\windows-repair.ps1"
|
||||||
|
|
||||||
# Check for administrator privileges
|
# Check for administrator privileges and if no, elevate
|
||||||
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S-1-5-32-544')) {
|
||||||
# Restart with elevated privileges
|
Start-Process -FilePath 'powershell' -Verb RunAs -ArgumentList "-ExecutionPolicy Bypass -NoProfile -File `"$PSCommandPath`" $args"
|
||||||
Start-Process powershell.exe -Verb RunAs -ArgumentList "-File `"$($MyInvocation.MyCommand.Path)`""
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "`nFIXING WINDOWS FULL STYLE`n"
|
Write-Host "`nFIXING WINDOWS FULL STYLE`n"
|
||||||
@@ -27,11 +25,11 @@ DISM /Online /Cleanup-Image /RestoreHealth # powershell checks image and replace
|
|||||||
Write-Host "LAUNCHING SYSTEM FILE CHECKER (sfc)"
|
Write-Host "LAUNCHING SYSTEM FILE CHECKER (sfc)"
|
||||||
sfc /scannow # cmd system file checker, retreives and replaces bad system files
|
sfc /scannow # cmd system file checker, retreives and replaces bad system files
|
||||||
|
|
||||||
# Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (chkdsk)"
|
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 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
|
||||||
|
|
||||||
Write-Host "`nREBOOTING IN 5 MINUTES`n"
|
# Write-Host "`nREBOOTING IN 5 MINUTES`n"
|
||||||
shutdown /r /t 300
|
# shutdown /r /t 300
|
||||||
Reference in New Issue
Block a user