Flare
Commander
- Registriert
- Aug. 2010
- Beiträge
- 2.068
Hallo, mit diesem Tipp kann man sich eine immer frische .reg Datei zum Aufdecken aller Windows Energieeinstellungen erstellen.
Dieser Weg sollte sicher sein, da man den gesammten Code vorher ansehen kann bevor man ihn ausführt.
Es funktioniert so:
Den Code unterhalb der Linie in Powershell ausführen und die Antwort in eine neue ".txt" Datei (Desktop Rechtsklick) kopieren und als ".reg" Datei speichern.
Wenn diese .reg ausgeführt wird werden alle verfügbaren Powersettings in den zusätzlichen erweiterten Energieeinstellungen aufgedeckt.
Execute the code under the line in Powershell, copy the answer in a new ".txt" file (desktop rightclick), save that file as a .reg file.
If that .reg is executed, all hidden powersettings will be unhidden in the advanced powersettings of windows.
__________________________________________________________________________________________________________________________
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.reg
# Then edit and run powercfg.reg
# Adapted from https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
echo "Windows Registry Editor Version 5.00"
echo ""
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 = ($powerSettingInSubgroubTable | Where-Object PartComponent -Match "$guid")
if (!$s) {
return
}
$tmp = $s.GroupComponent
$tmp = $tmp.Remove(0, $tmp.LastIndexOf('{') + 1)
$tmp = $tmp.Remove($tmp.LastIndexOf('}'))
$groupguid = $tmp
$s = ($powerSettingTable | Where-Object InstanceID -Match "$guid")
$descr = [string]::Format("; {0}", $s.ElementName)
# $runcfg = [string]::Format("powercfg -attributes {0} {1} -ATTRIB_HIDE", $groupguid, $guid)
$header = [string]::Format("[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\{0}\{1}]", $groupguid, $guid)
Write-Output $descr
Write-Output $header
Write-Output '"Attributes"=dword:00000002'
Write-Output ""
}
Read-Host -Prompt 'Press ENTER to quit.'
Dieser Weg sollte sicher sein, da man den gesammten Code vorher ansehen kann bevor man ihn ausführt.
Es funktioniert so:
Den Code unterhalb der Linie in Powershell ausführen und die Antwort in eine neue ".txt" Datei (Desktop Rechtsklick) kopieren und als ".reg" Datei speichern.
Wenn diese .reg ausgeführt wird werden alle verfügbaren Powersettings in den zusätzlichen erweiterten Energieeinstellungen aufgedeckt.
Execute the code under the line in Powershell, copy the answer in a new ".txt" file (desktop rightclick), save that file as a .reg file.
If that .reg is executed, all hidden powersettings will be unhidden in the advanced powersettings of windows.
__________________________________________________________________________________________________________________________
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.reg
# Then edit and run powercfg.reg
# Adapted from https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
echo "Windows Registry Editor Version 5.00"
echo ""
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 = ($powerSettingInSubgroubTable | Where-Object PartComponent -Match "$guid")
if (!$s) {
return
}
$tmp = $s.GroupComponent
$tmp = $tmp.Remove(0, $tmp.LastIndexOf('{') + 1)
$tmp = $tmp.Remove($tmp.LastIndexOf('}'))
$groupguid = $tmp
$s = ($powerSettingTable | Where-Object InstanceID -Match "$guid")
$descr = [string]::Format("; {0}", $s.ElementName)
# $runcfg = [string]::Format("powercfg -attributes {0} {1} -ATTRIB_HIDE", $groupguid, $guid)
$header = [string]::Format("[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\{0}\{1}]", $groupguid, $guid)
Write-Output $descr
Write-Output $header
Write-Output '"Attributes"=dword:00000002'
Write-Output ""
}
Read-Host -Prompt 'Press ENTER to quit.'