Skip to content

Instantly share code, notes, and snippets.

@longgiangp
longgiangp / Unlock-PowerCfg.ps1
Last active September 29, 2021 00:09 — forked from Velocet/Unlock-PowerCfg.ps1
[win] Unlock every Power Plan & Option
#Requires -RunAsAdministrator
if (!$IsLinux -and !$IsMacOS) {
# Unlock Power Plans by disabling "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Unlock hidden options
$PowerSettings = Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse -Depth 1 | Where-Object {
$_.PSChildName -NotLike 'DefaultPowerSchemeValues' -and $_.PSChildName -NotLike '0' -and $_.PSChildName -NotLike '1'
}