Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # “Start\Control Panel\System and Security\Power Options“ öffnen und den Modus “High Performance” auswählen.
  2. # Höchstleistung aktivieren = SCHEME_MIN
  3. $SCHEME_MIN = "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
  4. powercfg /SetActive $SCHEME_MIN
  5.  
  6. $Index = 0 # 0 für aus bzw. nix machen
  7.  
  8. # Damit die Harddisk nicht ausgeschaltet wird, den Wert auf „Never“ (vor 1) setzen.
  9. powercfg -x -monitor-timeout-ac $Index
  10. powercfg -x -monitor-timeout-dc $Index
  11. powercfg -x -disk-timeout-ac $Index
  12. powercfg -x -disk-timeout-dc $Index
  13. powercfg -x -standby-timeout-ac $Index
  14. powercfg -x -standby-timeout-dc $Index
  15. powercfg -x -hibernate-timeout-ac $Index
  16. powercfg -x -hibernate-timeout-dc $Index
  17.  
  18. # powercfg /SET??VALUEINDEX SCHEMA-GUID UNTER-GUID EINSTELLUNGS-GUID
  19. function ChangePowerSetting($SUB_GUID, $SETTING_GUID, $SETTING_INDEX)
  20. {
  21.     Write-Host "$SETTING_GUID to $SETTING_INDEX"
  22.     powercfg -SetDcValueIndex $SCHEME_MIN $SUB_GUID $SETTING_GUID $SETTING_INDEX
  23.     powercfg -SetAcValueIndex $SCHEME_MIN $SUB_GUID $SETTING_GUID $SETTING_INDEX  
  24. }
  25.  
  26. # Unter „USB settings“, „USB selective suspend setting“ Disabled auswählen.
  27.  
  28. $USBSetting = "2a737441-1930-4402-8d77-b2bebba308a3" # USB settings
  29. $USBSelectiveSuspendSetting = "48e6b7a6-50f5-4782-a5d4-53bb8f07e226" # USB selective suspend setting
  30. ChangePowerSetting $USBSetting $USBSelectiveSuspendSetting $Index
  31.  
  32. #Unter „PCI Express“, „Link State Power Management“ „Setting: Off“ auswählen
  33.  
  34. $SUB_PCIEXPRESS = "501a4d13-42af-4429-9fd1-a8218c268e20" # PCI Express“
  35. $ASPM = "ee12f906-d277-404b-b6da-e5fa1a576df5" # Verbindungszustand-Energieverwaltung / Link State Power Management
  36. ChangePowerSetting $SUB_PCIEXPRESS $ASPM $Index
  37.  
  38. <#
  39. Gerätetasten
  40.  
  41. Die Einstellungen der Gerätetasten / Power Button Settings muss so angepasst werden, dass das System nicht aus
  42. Versehen oder beabsichtigt mit der Taste am Frontpaneel oder mit der Tastatur heruntergefahren werden kann.
  43.  
  44. Control Panel > Hardware and Sounds > Power Options > System Settings > Power and sleep buttons setting
  45.  
  46. Bei allen: Do nothing
  47. #>
  48.  
  49. $PowerButtonsSettings = "4f971e89-eebd-4455-a8de-9e59040e7347"
  50. $PowerButtonAction = "7648efa3-dd9c-4e3e-b566-50f929386280" # To Change Default Power Button Action for Current Power Plan
  51. $LidCloseAction = "5ca83367-6e45-459f-a27b-476b1d01c936" # To Change Default Lid Close Action for Specific Power Plan
  52. $SleepButtonAction = "96996bc0-ad50-47ec-923b-6f41874dd9eb" # To Change Default Sleep Button Action for Specific Power Plan
  53.  
  54. $Actions = @($PowerButtonAction, $LidCloseAction, $SleepButtonAction)
  55. foreach ($Action in $Actions)
  56. {
  57.     ChangePowerSetting $PowerButtonsSettings $Action $Index
  58. }
  59.  
  60. #Haken entfernen bei “Turn on fast start-up (recommended)”
  61. #Disable Windows 10 fast boot via Powershell
  62. # /v is the REG_DWORD /t Specifies the type of registry entries /d Specifies the data for the new entry /f Adds or deletes registry content without prompting for confirmation.
  63. REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d "0" /f
  64. powercfg /hibernate off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement