From 63ab013ba4fa97920a63f82807af74e6ca577ce2 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Fri, 26 Sep 2025 22:25:08 -0600 Subject: [PATCH] workans --- Windows-Scripts/force_me_off.ps1 | 43 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/Windows-Scripts/force_me_off.ps1 b/Windows-Scripts/force_me_off.ps1 index 0338487..678c222 100644 --- a/Windows-Scripts/force_me_off.ps1 +++ b/Windows-Scripts/force_me_off.ps1 @@ -13,18 +13,6 @@ $wait_minutes = (($Hours*60)+$Minutes) $total_wait_minutes = ($wait_minutes+$GraceMinutes) $total_wait_seconds = ($total_wait_minutes*60) $reboot_time = $((Get-Date).AddHours($Hours).AddMinutes($Minutes + $GraceMinutes).ToString("hh:mm:ss tt")) - -function NotifyUser { - # notify user - ## Warning - Write-Host "`nFORCING YOUR STUPID ASS OFF IN $Hours hours $Minutes minutes plus $GraceMinutes minutes grace period`n" - ## current time - Write-Host "$(Get-Date -Format 'hh:mm:ss tt') | Start Time" - ## shutdown time - Write-Host "$reboot_time | Reboot Time" - ## send da webhookd thingggg - webhook "FORCING OFF FROM WINDOWS AT $reboot_time" true -} function ForceOff { # time wasters ## checks C drive after reboot to waste time and fix errors @@ -58,7 +46,34 @@ if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti shutdown -a # post to terminal and send webhook -NotifyUser +# notify user +## Warning +Write-Host "`nFORCING YOUR STUPID ASS OFF IN $Hours hours $Minutes minutes plus $GraceMinutes minutes grace period`n" +## current time +Write-Host "$(Get-Date -Format 'hh:mm:ss tt') | Start Time" +## shutdown time +Write-Host "$reboot_time | Reboot Time" +## send da webhookd thingggg +webhook "FORCING OFF FROM WINDOWS AT $reboot_time" true # fork dis one to backgruond -ForceOff & \ No newline at end of file +Start-Process -ScriptBlock { + # time wasters + ## checks C drive after reboot to waste time and fix errors + ## chkdsk /r C: # as admin + chkdsk /r C: + pause # pause for clarity + + # Do the sleep + Start-Sleep -Seconds $total_wait_seconds + + # do rebot + ## schedule shutdown + ## redundant but also for warnings + ### reboot (-r) forced (-t) in seconds (-t) + shutdown -r -f -t ($total_wait_seconds+10) # 10 second bonus to defer to Start-MpWDOScan + ## Start Windows Defender Offline Scan + ## wastes time + ## does the actual reboot + Start-MpWDOScan +} \ No newline at end of file