From 31a6e203a66d8f6cd7a6bb86e5da8f8fdf8c8b3d Mon Sep 17 00:00:00 2001 From: GoFish Date: Sun, 5 Jul 2020 18:12:23 +0000 Subject: [PATCH] More power profile configuration --- windows_to_go.ps1 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/windows_to_go.ps1 b/windows_to_go.ps1 index 102847e..20db84a 100644 --- a/windows_to_go.ps1 +++ b/windows_to_go.ps1 @@ -34,8 +34,19 @@ if ($env:computername -ne $computername) { Enable-UAC # Power profile -## Set to maximum performances -powercfg /s scheme_min -## Do not sleep when lid is closed -powercfg /setacvalueindex scheme_min sub_buttons lidaction 0 -powercfg /setdcvalueindex scheme_min sub_buttons lidaction 0 +## Set power plan to high performances +powercfg /setactive scheme_min +## Unhide "Lid close action" in plan advanced power settings +powercfg -attributes sub_buttons lidaction -attrib_hide +## Unhide "Power button action" in plan advanced power settings +powercfg -attributes sub_buttons pbuttonaction -attrib_hide +## Do not sleep when lid is closed. This will not change the value in "Control Panel\Hardware and Sound\Power Options\System Settings", but it will still work. +powercfg /setacvalueindex scheme_current sub_buttons lidaction 0 +powercfg /setdcvalueindex scheme_current sub_buttons lidaction 0 +## Do not sleep when power button is pressed. This will not change the value in "Control Panel\Hardware and Sound\Power Options\System Settings", but it will still work. +powercfg /setacvalueindex scheme_current sub_buttons pbuttonaction 0 +powercfg /setdcvalueindex scheme_current sub_buttons pbuttonaction 0 +# Turn off display after 30 minutes of inactivity on AC +powercfg /setacvalueindex scheme_current sub_video videoidle 1800 +# Re-activate current scheme to make settings take effect immediately +powercfg /setactive scheme_current \ No newline at end of file