Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ultimate Performance power plan deactivation #2728

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions functions/public/Invoke-WPFUltimatePerformance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ Function Invoke-WPFUltimatePerformance {

} elseif ($State -eq "Disable") {
# Check if the Ultimate Performance plan is installed by GUID
$installedPlan = powercfg -list | Select-String -Pattern $ultimateGUID
$installedPlan = (powercfg -list | Select-String -Pattern "ChrisTitus - Ultimate Power Plan").Line.Split()[3]

if ($installedPlan) {
# Extract the GUID of the installed Ultimate Performance plan
$ultimatePlanGUID = $installedPlan.Line.Split()[3]

# Set a different power plan as active before deleting the Ultimate Performance plan
$balancedPlanGUID = (powercfg -list | Select-String -Pattern "Balanced").Line.Split()[3]
$balancedPlanGUID = 381b4222-f694-41f0-9685-ff5bb260df2e
powercfg -setactive $balancedPlanGUID

# Delete the Ultimate Performance plan by GUID
Expand Down
Loading