Update hibernate.ps1

This commit is contained in:
Markus Fleschutz 2023-07-22 15:08:32 +02:00
parent 4376aa3405
commit 82d8ad6d84

View File

@ -2,9 +2,10 @@
.SYNOPSIS .SYNOPSIS
Hibernates the computer Hibernates the computer
.DESCRIPTION .DESCRIPTION
This PowerShell script enables hibernate mode for the local computer immediately. This PowerShell script hibernates the local computer immediately.
.EXAMPLE .EXAMPLE
PS> ./hibernate PS> ./hibernate.ps1
😴💤 Good night, I'm going to sleep deep...
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -12,7 +13,7 @@
#> #>
try { try {
"Bye bye." Write-Host "😴💤 Good night, I'm going to sleep deep..."
& rundll32.exe powrprof.dll,SetSuspendState 1,1,0 # bHibernate,bForce,bWakeupEventsDisabled & rundll32.exe powrprof.dll,SetSuspendState 1,1,0 # bHibernate,bForce,bWakeupEventsDisabled
exit 0 # success exit 0 # success
} catch { } catch {