Skip to content

Instantly share code, notes, and snippets.

@Velocet
Last active April 23, 2024 22:32
Show Gist options
  • Star 49 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Velocet/7ded4cd2f7e8c5fa475b8043b76561b5 to your computer and use it in GitHub Desktop.
Save Velocet/7ded4cd2f7e8c5fa475b8043b76561b5 to your computer and use it in GitHub Desktop.
Unlock/Unhide all Power Plan Settings/Options on Windows 10/11

Unlock-PowerCfg 1.1.0

Unlock every Power Plan Scheme/Setting on Windows 10/11. Just paste in an elevated PowerShell.

Use this instead of some incomplete PowerCfg commands or old .reg files as this script works even for newer/unknown settings: It will look up the PowerSettings registry hive and add or change a value (Attributes = 2) to reveal it.

Requirements:

  • Windows 7 - 11
  • PowerShell v2 - v7 with admin rights

Also have a look at: https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c

#Requires -RunAsAdministrator
# Unlock-PowerCfg - v22.05.11
# Disable "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$'
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force }
(gci 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$' | % {sp $_.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment