Ver código fonte

Upload files to 'DisableDeviceManagerPowerSaving'

nathan 1 ano atrás
pai
commit
b39491da01

+ 2
- 0
DisableDeviceManagerPowerSaving/DisablePowerSavingInDeviceManager-Bootstrap.bat Ver arquivo

@@ -0,0 +1,2 @@
1
+    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe Unblock-File .\DisablePowerSavingInDeviceManager.ps1
2
+    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted .\DisablePowerSavingInDeviceManager.ps1

+ 15
- 0
DisableDeviceManagerPowerSaving/DisablePowerSavingInDeviceManager.ps1 Ver arquivo

@@ -0,0 +1,15 @@
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
+
6
+Get-CimInstance -ClassName MsPower_deviceEnable -Namespace root/WMI | Set-CimInstance -Property @{Enable = $false}
7
+
8
+powercfg -import .\UltimatePerformanceEnhanced.pow
9
+pause
10
+$p = Get-CimInstance -Name root\cimv2\power -Class win32_PowerPlan -Filter "ElementName = '<UltimatePerformance>'
11
+
12
+powercfg /setactive ([string]$p.InstanceID).Replace("Microsoft:PowerPlan\{","").Replace("},"UltimatePerformance"
13
+
14
+
15
+### Script written by Nathan Deuster ###

Powered by TurnKey Linux.