Skip to content

Instantly share code, notes, and snippets.

@default-writer
Created August 17, 2023 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save default-writer/7257a734def25a2f3b6c636c8fb463d7 to your computer and use it in GitHub Desktop.
Save default-writer/7257a734def25a2f3b6c636c8fb463d7 to your computer and use it in GitHub Desktop.
CPU maximum frequency setup
$targetFrequency = 2266 # 2266 MHz in MHz
# Get the current power plan
$currentPlan = powercfg -getactivescheme
$guidPattern = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
$matches = $currentPlan | Select-String -Pattern $guidPattern -AllMatches
$guid = $matches.Matches[0].Value
# Set the maximum processor frequency
powercfg -setacvalueindex $guid 54533251-82be-4824-96c1-47b60b740d00 75b0ae3f-bce0-45a7-8c89-c9611c25e100 $targetFrequency
powercfg -setdcvalueindex $guid 54533251-82be-4824-96c1-47b60b740d00 75b0ae3f-bce0-45a7-8c89-c9611c25e100 $targetFrequency
# Apply the changes to the power plan
powercfg -s $guid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment