3

I recently just upgraded to Windows 10 version 2004. Before that, I created a power plan in addition to the default one, which is used to keep the computer awake seeding torrents, and doing BOINC tasks.

Thus in that power plan, I set the "Lid close action" to "Do nothing" in advanced power settings. When I upgraded to version 2004, the category "Power buttons and lid" is not visible anymore. This is what it would appear before, I know how to use commands to unhide it again, but it looks like the update has hidden all of the subcategory options (Lid close action, Power buttons action, Lid open action). When I execute the command, only the subcategory 'Lid close action' and the category containing it showed up, and not all of them.

I have no idea if it was Microsoft that hide them or am I just mistaking that with some software failures?

1 Answers1

3

Is this everything you want: enter image description here

After my own ordeal with displaying "System Unattended Sleep Timeout", which can prematurely darken the screen bfore the designatged time, and helping another user with a differnt settng, I wrote a script to query all available Power options, display them in a grid control with their current visibility state, and allow the user to select options and toggle their visivbility.

When you run the code below, you will be presented with a GridView control listing the option's:

  • Attributes(visibility) 1 = Disabled 2 = Enabled
  • GUID
  • Name

enter image description here

Although you can just scroll through the options, the GridView control allows you to filter using the Add Criteria button in the upper left: enter image description here

Select the rows with the opitons whose Attributes you wish to toggle. Use + to multi-select rows. Then click "OK"

Restart for changes to take effect


Copy & Paste the following code into an Administrator PowerShell window. Press to execute.

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

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