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