Last active
April 1, 2023 07:37
-
-
Save raymelon/e88e214043fbc72f2d80f3abf1b7c207 to your computer and use it in GitHub Desktop.
PowerShell - Power Plan Single Switcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $balanced = "BALANCED-GUID"; $highPerformance = "HIGHPERFORMANCE-GUID"; If ((powercfg /getactivescheme) -like "*" + $balanced + "*") { echo "balanced is active. setting to high performance..."; powercfg /setactive $highPerformance; powercfg /getactivescheme; echo "`nwaiting for 5min before setting back to balanced..."; Wait-Event -SourceIdentifier "ProcessStarted" -Timeout 300; powercfg /setactive $balanced; powercfg /getactivescheme; } ElseIf ((powercfg /getactivescheme) -like "*" + $highPerformance + "*") { echo "high peformance is active. setting to balanced..."; powercfg /setactive $balanced; powercfg /getactivescheme; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment