Nav apraksta

DisablePowerSavingInDeviceManager.ps1 759B

123456789101112131415
  1. if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
  2. Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
  3. exit;
  4. }
  5. Get-CimInstance -ClassName MsPower_deviceEnable -Namespace root/WMI | Set-CimInstance -Property @{Enable = $false}
  6. powercfg -import .\UltimatePerformanceEnhanced.pow
  7. pause
  8. $p = Get-CimInstance -Name root\cimv2\power -Class win32_PowerPlan -Filter "ElementName = '<UltimatePerformance>'
  9. powercfg /setactive ([string]$p.InstanceID).Replace("Microsoft:PowerPlan\{","").Replace("},"UltimatePerformance"
  10. ### Script written by Nathan Deuster ###

Powered by TurnKey Linux.