From fb30e285a76ecc953369c2a16deeae0b3ac0119d Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:47:31 +0100 Subject: [PATCH] fix: apply ultimate performance for deployment --- src/playbook/Configuration/custom.yml | 16 ++++++++++++++-- src/playbook/Configuration/tweaks.yml | 3 +-- .../misc/restore-default-sleep-timeout.yml | 7 ------- .../tweaks/scripts/script-power.yml | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) delete mode 100644 src/playbook/Configuration/tweaks/misc/restore-default-sleep-timeout.yml diff --git a/src/playbook/Configuration/custom.yml b/src/playbook/Configuration/custom.yml index f70bd206b8..5bf5fc2047 100644 --- a/src/playbook/Configuration/custom.yml +++ b/src/playbook/Configuration/custom.yml @@ -33,8 +33,20 @@ actions: - !run: {exe: 'explorer.exe', runas: 'currentUser', wait: false} # Prevent computer from going to sleep during deployment - - !run: {exe: 'powercfg.exe', args: '/setacvalueindex scheme_current sub_sleep standbyidle 0'} - - !run: {exe: 'powercfg.exe', args: '/setdcvalueindex scheme_current sub_sleep standbyidle 0'} + - !powerShell: + command: >- + $guid = New-Guid; + powercfg /duplicatescheme """e9a42b02-d5df-448d-aa00-03f14749eb61""" """$guid"""; + powercfg /setactive """$guid"""; + powercfg /xname """$guid""" """Atlas Installation Scheme""" """Duplicate of Ultimate Performance for installing Atlas."""; + powercfg /x monitor-timeout-ac 0; + powercfg /x monitor-timeout-dc 0; + powercfg /x disk-timeout-ac 0; + powercfg /x disk-timeout-dc 0; + powercfg /x standby-timeout-ac 0; + powercfg /x standby-timeout-dc 0; + powercfg /x hibernate-timeout-ac 0; + powercfg /x hibernate-timeout-dc 0; - !writeStatus: {status: 'Optimizing PowerShell'} tasks: diff --git a/src/playbook/Configuration/tweaks.yml b/src/playbook/Configuration/tweaks.yml index ab892a323a..c4bb1b95bc 100644 --- a/src/playbook/Configuration/tweaks.yml +++ b/src/playbook/Configuration/tweaks.yml @@ -330,7 +330,6 @@ tasks: - tweaks\scripts\script-mitigations.yml - tweaks\scripts\script-devices.yml - tweaks\scripts\script-pfp.yml - - tweaks\scripts\script-power.yml - tweaks\scripts\script-finalize.yml - tweaks\scripts\script-backup2.yml - tweaks\scripts\script-clientcbs.yml @@ -350,8 +349,8 @@ tasks: - tweaks\misc\delete-windows-specific-files.yml - tweaks\misc\config-oem-information.yml - tweaks\misc\rebuild-perf-counters.yml - - tweaks\misc\restore-default-sleep-timeout.yml - tweaks\misc\create-shortcuts.yml - tweaks\misc\add-music-videos-to-home.yml - tweaks\misc\add-newUsers-script.yml + - tweaks\scripts\script-power.yml # Done last on purpose - tweaks\misc\enable-notifications.yml diff --git a/src/playbook/Configuration/tweaks/misc/restore-default-sleep-timeout.yml b/src/playbook/Configuration/tweaks/misc/restore-default-sleep-timeout.yml deleted file mode 100644 index 9e34af2fca..0000000000 --- a/src/playbook/Configuration/tweaks/misc/restore-default-sleep-timeout.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Restore Default Sleep Timeout -description: Restores the default automatic sleep timeout if the power saving option is disabled -option: '!disable-power-saving' -actions: - - !run: {exe: 'powercfg.exe', args: '/setacvalueindex scheme_current sub_sleep standbyidle 900'} - - !run: {exe: 'powercfg.exe', args: '/setdcvalueindex scheme_current sub_sleep standbyidle 600'} diff --git a/src/playbook/Configuration/tweaks/scripts/script-power.yml b/src/playbook/Configuration/tweaks/scripts/script-power.yml index 6c6a6a8096..c61dbc302b 100644 --- a/src/playbook/Configuration/tweaks/scripts/script-power.yml +++ b/src/playbook/Configuration/tweaks/scripts/script-power.yml @@ -3,6 +3,7 @@ title: Configure Power Settings description: Executes script to configure power settings for the best performance, especially focusing on the lowest latency e.g. by reducing any potential jitter actions: # Disable Power Saving features + - !run: {exe: 'powercfg.exe', args: '/restoredefaultpowerschemes'} - !cmd: command: '"AtlasDesktop\3. General Configuration\Power\Power-saving\Disable Power-saving.cmd" -Silent' exeDir: true