This commit is contained in:
2026-06-13 02:36:49 -06:00
parent 174cc6b277
commit e56c36506a
+47 -39
View File
@@ -73,65 +73,73 @@ if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S
.............. ..............
'@ '@
Write-Host "`nFIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta Write-Host "FIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta
Write-Host "ABORTING ANY SCHEDULED SHUTDOWN 1/18" $LogDir = "$env:USERPROFILE\Downloads\Repair-Log-$((Get-Date).ToString('yyyy-MM-dd-HHmm'))" # path to new log Dir
shutdown.exe /a > $null 2> $null # cmd abort scheduled shutdowns $ErrorLog = "$LogDir\error.log" # error log file
$LogDir = "$env:USERPROFILE\Downloads\Repair-Log-$((Get-Date).ToString("yyyy-MM-dd-HHmm"))" Write-Host "Creating Log Dir at $LogDir 1/20"
Write-Host "Creating Log Dir at $LogDir 2/18" New-Item -Path "$LogDir" -ItemType Directory > $null 2>> $null # create log dir
New-Item -Path "$LogDir" -ItemType Directory > $null 2> $null
Write-Host "GENERATING AND DISPLAYING COMPREHENSIVE STABILITY REPORT 3/18" Write-Host "Initialize Log File $LogFile 2/20"
Start-Process "perfmon.exe" -ArgumentList "/report" -Wait Write-Host "$((Get-Date).ToString('yyyy-MM-dd-HHmm'))" 2>> "$ErrorLog"
Write-Host "GENERATING AND DISPLAYING STABILITY HISTORY REPORT 4/18" Write-Host "ABORTING ANY SCHEDULED SHUTDOWN 3/20"
Start-Process "perfmon.exe" -ArgumentList "/rel" -Wait shutdown.exe /a > $null 2>> "$ErrorLog" # cmd abort scheduled shutdowns
Write-Host "Creating Log Dir at $LogDir 4/20"
New-Item -Path "$LogDir" -ItemType Directory > $null 2>> "$ErrorLog" # create log dir
Write-Host "GENERATING AND DISPLAYING COMPREHENSIVE STABILITY REPORT 5/20"
Start-Process "perfmon.exe" -ArgumentList "/report" -Wait # running report
Write-Host "GENERATING AND DISPLAYING STABILITY HISTORY REPORT 6/20"
Start-Process "perfmon.exe" -ArgumentList "/rel" -Wait # historical report
Write-Host "CLEARING DNS 5/18" Write-Host "CLEARING DNS 7/20"
ipconfig.exe /flushsdns > $null ipconfig.exe /flushsdns > $null 2>> "$ErrorLog" # flush dns cache
Write-Host "CLEARING ARP CACHE 6/18" Write-Host "CLEARING ARP CACHE 8/20"
Remove-NetNeighbor -Confirm:$false > $null 2> $null Remove-NetNeighbor -Confirm:$false > $null 2>> "$ErrorLog" # flush ARP Table
Write-Host "CLEARING ALL SAMBA CREDENTIALS 7/18" Write-Host "CLEARING ALL SAMBA CREDENTIALS 9/20"
net.exe use * /delete /y > $null 2> $null # nuke all samba creds net.exe use * /delete /y > $null 2>> "$ErrorLog" # nuke all samba creds automagically
Write-Host "RELEASING AND RENEWING DHCP 8/18" Write-Host "RELEASING AND RENEWING DHCP 10/20"
# release and renew dhcp # release and renew dhcp
ipconfig.exe /release > $null ipconfig.exe /release > $null 2>> "$ErrorLog"
ipconfig.exe /renew > $null ipconfig.exe /renew > $null 2>> "$ErrorLog"
Write-Host "GETTING CONTROL OF WINDOWS UPDATE 9/18" Write-Host "GETTING CONTROL OF WINDOWS UPDATE 11/20"
Install-Module -Name PSWindowsUpdate -Force > $null 2> $null Install-Module -Name PSWindowsUpdate -Force > $null 2>> "$ErrorLog"
Import-Module PSWindowsUpdate Import-Module PSWindowsUpdate
Write-Host "UPDATING WINDOWS 10/18" Write-Host "UPDATING WINDOWS 12/20"
Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot > $null Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot > $null 2>> "$ErrorLog"
Write-Host "UPDATING MALWARE SIGNATURES 11/18" Write-Host "UPDATING MALWARE SIGNATURES 13/20"
Update-MpSignature # update windows defender malware siggs Update-MpSignature 2>> "$ErrorLog" # update windows defender malware siggs
Write-Host "RUNNING FULL WINDOWS DEFENDER SCAN 12/18" Write-Host "RUNNING FULL WINDOWS DEFENDER SCAN 14/20"
Start-MpScan -ScanType FullScan # full windows defender scan Start-MpScan -ScanType FullScan 2>> "$ErrorLog" # full windows defender scan
Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP 13/18" Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP 15/20"
DISM.exe /Online /Cleanup-Image /RestoreHealth # online check for bad files DISM.exe /Online /Cleanup-Image /RestoreHealth 2>> "$ErrorLog" # online check for bad files
Write-Host "RUNNING SYSTEM FILE CHECKER (SFC) 14/18" Write-Host "RUNNING SYSTEM FILE CHECKER (SFC) 16/20"
SFC.exe /scannow # older check for bad files SFC.exe /scannow 2>> "$ErrorLog" # older check for bad files
Write-Host "SCHEDULING ESSENTIAL FILE CHECK ON NEXT BOOT 15/18" Write-Host "SCHEDULING ESSENTIAL FILE CHECK ON NEXT BOOT 17/20"
SFC.exe /scanonce # check essential files on next boot SFC.exe /scanonce 2>> "$ErrorLog" # check essential files on next boot
Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK) 16/18" Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK) 18/20"
echo y | chkdsk.exe /f /r C: # cmd checks C drive after reboot to waste time and fix errors (noninteractive via y ffuckery) echo y | chkdsk.exe /f /r C: > $null 2>> "$ErrorLog" # cmd checks C drive after reboot to waste time and fix errors (noninteractive via y ffuckery)
Write-Host "SCHEDULINMG OFFLINE MEMTEST 17/18" Write-Host "SCHEDULINMG OFFLINE MEMTEST 19/20"
mdsched.exe /s # schedule offline memtest (noninteractive) mdsched.exe /s 2>> "$ErrorLog" # schedule offline memtest (noninteractive)
Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDLY 18/18" Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDLY 20/20"
Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot Start-MpWDOScan 2>> "$ErrorLog" # powershell starts Windows Defender Offline Scan after reboot
Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n" Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n"
shutdown.exe /r /t (60*5) # shutdown in 5 minutes as failsafe shutdown.exe /r /t (60*5) # shutdown in 5 minutes as failsafe