From 6b0b54fedfb5c58b83444d9a25eaea99ab9d9e35 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 22 Jul 2023 17:07:02 +0200 Subject: [PATCH] Update hibernate.ps1 --- Scripts/hibernate.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/hibernate.ps1 b/Scripts/hibernate.ps1 index 742c628b..047ab5df 100755 --- a/Scripts/hibernate.ps1 +++ b/Scripts/hibernate.ps1 @@ -5,7 +5,7 @@ This PowerShell script hibernates the local computer immediately. .EXAMPLE PS> ./hibernate.ps1 - 😴💤 Good night, I'm going to sleep deep... + It's 5:04 PM, going to sleep now... 😴💤 .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -13,7 +13,10 @@ #> try { - Write-Host "😴💤 Good night, I'm going to sleep deep..." + [system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US" + $CurrentTime = $((Get-Date).ToShortTimeString()) + Write-Host "It's $CurrentTime, going to sleep now... 😴💤p" + Start-Sleep -milliseconds 500 & rundll32.exe powrprof.dll,SetSuspendState 1,1,0 # bHibernate,bForce,bWakeupEventsDisabled exit 0 # success } catch {