Created
June 13, 2025 13:19
-
-
Save tomshaw/bf0134ff8f0ab8bfefc520ee4938c357 to your computer and use it in GitHub Desktop.
Useful PowerShell aliases to quickly shut down, restart, or sleep your Windows PC from the terminal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shutdown immediately | |
function Shutdown-Now { | |
shutdown /s /f /t 0 | |
} | |
Set-Alias sdnow Shutdown-Now | |
# Reboot immediately | |
function Reboot-Now { | |
shutdown /r /f /t 0 | |
} | |
Set-Alias sdreboot Reboot-Now | |
# Sleep the computer | |
function Sleep-Now { | |
rundll32.exe powrprof.dll,SetSuspendState 0,1,0 | |
} | |
Set-Alias sdsleep Sleep-Now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment