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