diff --git a/Windows-Scripts/IM_SO_TIRED_BOSS.ps1 b/Windows-Scripts/IM_SO_TIRED_BOSS.ps1 index 45aa797..1e74fa1 100644 --- a/Windows-Scripts/IM_SO_TIRED_BOSS.ps1 +++ b/Windows-Scripts/IM_SO_TIRED_BOSS.ps1 @@ -1,13 +1,29 @@ +# usage: +## All paramaters are optional +## All paramaters are compatible with each other +## Default behavior is to restart immediately after zero time +## IM_SO_TIRED_BOSS -Seconds -Minutes -Hours -ChkDsk $True +## Examples: +### IM_SO_TIRED_BOSS -Minutes 90 +### IM_SO_TIRED_BOSS -Minutes 30 -Hours 1 +### IM_SO_TIRED_BOSS -Minutes 30 -ChkDsk $True + Param( [int]$Seconds = 0, [int]$Minutes = 0, - [int]$Hours = 0 + [int]$Hours = 0, + [bool]$ChkDsk = $false ) # Force off for longer by doing offline modern chkdsk to tie up your computer to be unusable for a while # pipes y to it so its noninteractive -# Requires admin terminal -# Write-Host 'y' | chkdsk C: /f /r +# auto elevates to admin when run with -ChkDsk $True +if ($ChkDsk) { + # elevate to admin + # set for offline chkdsk noninteractively by piping y to it lmao + # runs a cmd window as admin running "echo y | chkdsk C: /f /r" which then closes + Start-Process cmd.exe -Verb RunAs -ArgumentList "/c echo y | chkdsk C: /f /r" +} # Current date object $CurrentTime = Get-Date @@ -37,5 +53,8 @@ Start-Job -ScriptBlock { # do the wait Start-Sleep -Seconds $WaitSeconds +# Add-Type -AssemblyName PresentationFramework +# [System.Windows.MessageBox]::Show("PING WORKING", "$RebootTime", 'OK', 'Error') + # Force reboot with no warning Restart-Computer -Force \ No newline at end of file