Skip to content

Instantly share code, notes, and snippets.

@Solaris17
Forked from Velocet/Unlock-PowerCfg.ps1
Last active August 23, 2024 21:15
Show Gist options
  • Save Solaris17/2328ec8e4d2e9cef95b6239f92431887 to your computer and use it in GitHub Desktop.
Save Solaris17/2328ec8e4d2e9cef95b6239f92431887 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