# List all possible power config GUIDs # Run: this-script.ps1 | Out-File powercfg.ps1 # Then edit and run powercfg.ps1 # (c) Pekka "raspi" Järvinen 2017 Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object { $tmp = $_.ManagedElement $tmp = $tmp.Remove(0, $tmp.LastIndexOf('{') + 1) $tmp = $tmp.Remove($tmp.LastIndexOf('}')) $guid = $tmp $s = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting | Where-Object InstanceID -Match "Microsoft:PowerSetting\\{$guid}" $descr = [string]::Format("# {0}", $s.ElementName) $runcfg = [string]::Format("powercfg -attributes {0} -ATTRIB_HIDE", $guid) Write-Output $descr Write-Output $runcfg }