rc.10
This commit is contained in:
@@ -19,7 +19,7 @@ if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S
|
||||
Clear-Host # clear window
|
||||
|
||||
# ascii art
|
||||
Write-Host -ForegroundColor Magenta @'
|
||||
echo -ForegroundColor Magenta @'
|
||||
.. .....
|
||||
....------..
|
||||
..:--------.. .......
|
||||
@@ -77,76 +77,76 @@ if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S
|
||||
$LogDir = "$env:USERPROFILE\Downloads\Repair-Log-$((Get-Date).ToString('yyyy-MM-dd-HHmm'))" # path to new log Dir
|
||||
$MainLog = "$LogDir\main.log" # error log file
|
||||
|
||||
Write-Host "FIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta
|
||||
echo "FIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta
|
||||
|
||||
Write-Host "`tCreating Log Dir at $LogDir 1/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))"
|
||||
echo "`tCreating Log Dir at $LogDir 1/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))"
|
||||
mkdir "$LogDir" > $null 2> $null # create log dir
|
||||
|
||||
Write-Host "`tInitialize Log File $LogFile 3/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))`nFollow Log File in Another Terminal With Get-Content `"$MainLog`" -Wait -Tail 50"
|
||||
echo "`tInitialize Log File $LogFile 3/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))`n`tFollow Log File in Another Terminal With`n`t`tGet-Content `"$MainLog`" -Wait -Tail 50"
|
||||
echo "$((Get-Date).ToString('yyyy-MM-dd-HHmm'))" >> "$MainLog"
|
||||
|
||||
Write-Host "`tOpening Log Dir 2/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tOpening Log Dir 2/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
explorer.exe "$LogDir"
|
||||
|
||||
Write-Host "`tABORTING ANY SCHEDULED SHUTDOWN 4/21 AT $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tABORTING ANY SCHEDULED SHUTDOWN 4/21 AT $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
shutdown.exe /a > $null 2>> "$MainLog" # cmd abort scheduled shutdowns
|
||||
|
||||
Write-Host "`tCreating Log Dir at $LogDir 5/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tCreating Log Dir at $LogDir 5/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
New-Item -Path "$LogDir" -ItemType Directory > $null 2>> "$MainLog" # create log dir
|
||||
|
||||
Write-Host "`tGenerating and Displaying Comprehensive Stability Report 6/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tGenerating and Displaying Comprehensive Stability Report 6/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Start-Process "perfmon.exe" -ArgumentList "/report" -Wait # running report
|
||||
|
||||
Write-Host "`tGenerating and Displaying Stability History Report 7/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tGenerating and Displaying Stability History Report 7/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Start-Process "perfmon.exe" -ArgumentList "/rel" -Wait # historical report
|
||||
|
||||
Write-Host "`tClearning DNS Cache 8/21 $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tClearning DNS Cache 8/21 $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
ipconfig.exe /flushsdns > $null 2>> "$MainLog" # flush dns cache
|
||||
|
||||
Write-Host "`tClearing ARP Table 9/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tClearing ARP Table 9/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Remove-NetNeighbor -Confirm:$false > $null 2>> "$MainLog" # flush ARP Table
|
||||
|
||||
Write-Host "`tClearing ALL Samba Credentials 10/21 $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tClearing ALL Samba Credentials 10/21 $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
net.exe use * /delete /y > $null 2>> "$MainLog" # nuke all samba creds automagically
|
||||
|
||||
Write-Host "`tReleasing and Renweing DHCP 11/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tReleasing and Renweing DHCP 11/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
# release and renew dhcp
|
||||
ipconfig.exe /release > $null 2>> "$MainLog"
|
||||
ipconfig.exe /renew > $null 2>> "$MainLog"
|
||||
|
||||
Write-Host "`tGetting Control of Windows Update 12/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tGetting Control of Windows Update 12/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Install-Module -Name PSWindowsUpdate -Force 1> $null 2>> "$MainLog"
|
||||
Import-Module PSWindowsUpdate
|
||||
|
||||
Write-Host "`tUpdating Windows 13/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tUpdating Windows 13/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot > $null 2>> "$MainLog"
|
||||
|
||||
Write-Host "`tUpdating Malware Signatures 14/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tUpdating Malware Signatures 14/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Update-MpSignature 2>> "$MainLog" # update windows defender malware siggs
|
||||
|
||||
Write-Host "`tRunning FULL Windows Defender SCAN 15/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tRunning FULL Windows Defender SCAN 15/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Start-MpScan -ScanType FullScan 2>> "$MainLog" # full windows defender scan
|
||||
|
||||
Write-Host "`tRunning DISM Online Image Cleanup 16/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tRunning DISM Online Image Cleanup 16/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
DISM.exe /Online /Cleanup-Image /RestoreHealth 2>> "$MainLog" # online check for bad files
|
||||
|
||||
Write-Host "`tRunning System File Checker 17/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tRunning System File Checker 17/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
SFC.exe /scannow 2>> "$MainLog" # older check for bad files
|
||||
|
||||
Write-Host "`tScheduling Essential File Check on Next Boot 18/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tScheduling Essential File Check on Next Boot 18/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
SFC.exe /scanonce 2>> "$MainLog" # check essential files on next boot
|
||||
|
||||
Write-Host "`tScheduling Offline chkdsk and repair of C: 19/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tScheduling Offline chkdsk and repair of C: 19/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo y | chkdsk.exe /f /r C: > $null 2>> "$MainLog" # cmd checks C drive after reboot to waste time and fix errors (noninteractive via y ffuckery)
|
||||
|
||||
Write-Host "`tScheduling Offline Memory Test at Next Boot 20/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tScheduling Offline Memory Test at Next Boot 20/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))" | Tee-Object -FilePath "$MainLog" -Append
|
||||
mdsched.exe /s 2>> "$MainLog" # schedule offline memtest (noninteractive)
|
||||
|
||||
Write-Host "`tScheduling Windows Defender Offline Scan 21/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))`n`tMAY REBOOT UNEXPECTEDLY" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`tScheduling Windows Defender Offline Scan 21/21 at $((Get-Date).ToString('yyyy-MM-dd-HHmm'))`n`tMAY REBOOT UNEXPECTEDLY" | Tee-Object -FilePath "$MainLog" -Append
|
||||
Start-MpWDOScan 2>> "$MainLog" # powershell starts Windows Defender Offline Scan after reboot
|
||||
|
||||
Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n"
|
||||
echo "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n"
|
||||
shutdown.exe /r /t (60*5) # shutdown in 5 minutes as failsafe
|
||||
|
||||
Write-Host "`n$((Get-Date).ToString('yyyy-MM-dd-HHmm'))`n`nDONEsiez :3~`n" | Tee-Object -FilePath "$MainLog" -Append
|
||||
echo "`n$((Get-Date).ToString('yyyy-MM-dd-HHmm'))`n`nDONEsiez :3~`n" | Tee-Object -FilePath "$MainLog" -Append
|
||||
}
|
||||
Reference in New Issue
Block a user