From d93a43d260025f77b7e03ea24d880869c4d29e78 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Fri, 15 Sep 2023 16:48:07 -0400 Subject: [PATCH] initial commit --- Fix-EnableAdditionalPowerOptions.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Fix-EnableAdditionalPowerOptions.ps1 diff --git a/Fix-EnableAdditionalPowerOptions.ps1 b/Fix-EnableAdditionalPowerOptions.ps1 new file mode 100644 index 0000000..1b44c92 --- /dev/null +++ b/Fix-EnableAdditionalPowerOptions.ps1 @@ -0,0 +1,11 @@ +# Disable unattended sleep timeout (if computer was woken up by an unattended process, this timer kicks in) +# The default value for this setting is 120 (2 minutes) +# Aliases: +# SUB_SLEEP = 238c9fa8-0aad-41ed-83f4-97be242c8f20 +# UNATTENDSLEEP = 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 +$UnattendedSleepTimeout = 0 +Try { + Start-Process "powercfg.exe" -ArgumentList "/setacvalueindex SCHEME_CURRENT SUB_SLEEP UNATTENDSLEEP ${UnattendedSleepTimeout}" -Wait + Start-Process "powercfg.exe" -ArgumentList "/setdcvalueindex SCHEME_CURRENT SUB_SLEEP UNATTENDSLEEP ${UnattendedSleepTimeout}" -Wait +} +Catch { Write-Error $_.Exception.Message } \ No newline at end of file