Skip to content

Commit 0e18b35

Browse files
committed
fix: update power scheme check to use GUIDs for accuracy
1 parent 254c201 commit 0e18b35

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/renderer/src/pages/Utilities.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,14 @@ if ($gpus) {
181181
options: ["Balanced", "High Performance", "Power Saver", "Ultimate Performance"],
182182
checkScript: `
183183
$current = powercfg /getactivescheme
184-
if ($current -match "Power saver") { Write-Output "Power Saver" }
185-
elseif ($current -match "High performance") { Write-Output "High Performance" }
186-
elseif ($current -match "Ultimate Performance") { Write-Output "Ultimate Performance" }
187-
else { Write-Output "Balanced" }
184+
$currentGUID = ($current -split ' ')[3]
185+
186+
switch ($currentGUID) {
187+
"a1841308-3541-4fab-bc81-f71556f20b4a" { Write-Output "Power Saver" }
188+
"8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" { Write-Output "High Performance" }
189+
"e9a42b02-d5df-448d-aa00-03f14749eb61" { Write-Output "Ultimate Performance" }
190+
default { Write-Output "Balanced" }
191+
}
188192
`,
189193
applyScript: {
190194
Balanced: `powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e`,

0 commit comments

Comments
 (0)