1758978811

This commit is contained in:
2025-09-27 07:13:31 -06:00
parent 944b058b64
commit e41d4a4bfa
+13 -9
View File
@@ -62,13 +62,15 @@ webhook "FORCING OFF FROM WINDOWS AT $reboot_time" true
# time wasters # time wasters
## checks C drive after reboot to waste time and fix errors ## checks C drive after reboot to waste time and fix errors
## chkdsk /r C: # as admin ## chkdsk /r C: # as admin
chkdsk /r C: ## make it do it noninteractively with echo y
## echo specifically seems needeed
echo y | chkdsk /r C:
$background_scriptblock = { # shutdown tasks
shutdown.exe -r -t ($total_wait_seconds+10) # 10 second bonus to defer to Start-MpWDOScan ## schedule normal shutdown as backup and for warnings
Start-Sleep -Seconds $total_wait_seconds shutdown -f -r -t ($total_wait_seconds+10) # 10 second bonus to defer to Start-MpWDOScan
Start-MpWDOScan ## do the actual reboot by triggerinmg Start-MpWDOScan
} Start-Sleep -Seconds ($Seconds+60) && Write-Host "Start-MpWDOScan" && webhook "REBOOTAN <@&1369280290203373670>"
# $test_background_scriptblock = { # $test_background_scriptblock = {
# Write-Host $total_wait_seconds # Write-Host $total_wait_seconds
@@ -76,11 +78,13 @@ $background_scriptblock = {
# Start-Process "pwsh.exe" -Verb RunAs # Start-Process "pwsh.exe" -Verb RunAs
# } # }
$command_string = "-NoExit", "-WindowStyle", "Hidden", "-Command", "& { $background_scriptblock }" # $command_string = "-NoExit", "-WindowStyle", "Hidden", "-Command", "& { $background_scriptblock }"
# $test_command_string = "-Command ", "& { $test_background_scriptblock }" # $test_command_string = "-Command ", "& { $test_background_scriptblock }"
Write-Host $test_command_string # Write-Host $test_command_string
# send it to background! # send it to background!
Start-Process -FilePath "pwsh.exe" -ArgumentList $command_string -Verb RunAs
# Start-Process pwsh -ArgumentList $command_string -Verb RunAs
# Start-Process -FilePath "pwsh.exe" -ArgumentList $test_command_string -Verb RunAs # Start-Process -FilePath "pwsh.exe" -ArgumentList $test_command_string -Verb RunAs