1

I found one script on the internet, but it doesn't enable all of them. I am looking to enable the maximum CPU usage option and set it to around 80% to prevent the CPU from overheating on my laptop.

https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c

This doesn't enable Maximum processor frequency

2 Answers2

3

Here's a PowerShell script I wrote that lists all available POwer Options in a GridView control. Copy the entire script, paste into an Administrative PowerShell console, and press <Enter> to run:

Function Toggle-PowerSettingsVisibility {
    $Title         = 'Select option(s) to toggle visibility'
    $PowerSettings = 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings'
    @( [PSCustomObject]@{
            Attributes  = 0
            PSChildName = '{ -- No Changes -- }'
            Name        = ' "Safety" row to clear selection'
    } ) +
    @( Get-ChildItem $PowerSettings -Recurse | ? Property -contains 'Attributes' | Get-ItemProperty |
        Select Attributes, PSCHildName,
               @{ N = 'Name' ; E = { $_.FriendlyName.Split(',')[-1] }} ) | Sort PSChildName |
    Out-GridView -Passthru -Title $Title | ForEach {
        $Splat = @{
            Path  = Resolve-Path "$PowerSettings\*\$($_.PSChildName)"
            Name  = 'Attributes'
            Value = $_.Attributes -bXor 0x0000003 
        }
        Set-ItemProperty @Splat
    }
}
Toggle-PowerSettingsVisibility

THe Attributes column displays 2 for visible items and 1 for hidden items: enter image description here

Type Maximum in the Filter textbox, select your desired option(s) and click OK: enter image description here

That's it!

enter image description here

Keith Miller
  • 10,694
  • 1
  • 20
  • 35
0

Taken from https://superuser.com/a/1689410

As an admin, this PowerShell script will unhide every power option in Power Options after running and restarting.

# Path to PowerSettings in Windows registry
# Set 'Attributes=2' to show in Power Options on each directory and subdirectory

$powerPath = "HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings" $powerQuery = reg query $powerPath foreach ($regDir in $powerQuery) {

$subPowerQuery = reg query $regDir
foreach ($subDir in $subPowerQuery) {
    $subActive = $subDir -replace &quot;HKEY_LOCAL_MACHINE&quot; , &quot;HKLM:&quot;
    Get-ItemProperty -Path $subActive
    Set-ItemProperty -Path &quot;$subActive&quot; -Name &quot;Attributes&quot; -Value '2'
}

$active = $regDir -replace &quot;HKEY_LOCAL_MACHINE&quot; , &quot;HKLM:&quot;
Get-ItemProperty -Path $active
Set-ItemProperty -Path &quot;$active&quot; -Name &quot;Attributes&quot; -Value '2'

}

From there you can go

  • Power & sleep
  • Additional power settings
  • Power Options / Change plan settings
  • Change advanced power settings

Under the 'Processor power management' tree there are oodles of options. You may be looking for 'Maximum processor state' or another one, I'm not sure.

windows power options dialog showing maximum processor state option

Aaron B
  • 101
  • 1