Disable powercfg fix (#2728)

This commit is contained in:
Atis 2024-09-20 16:04:26 +02:00 committed by GitHub
parent 3f2759f967
commit 377758758e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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