From 91182d4910eb923ee02c751f66fd2877d7605029 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sun, 24 Apr 2022 08:29:37 -0500 Subject: [PATCH] Add power plan detection - Added detection to see if the Power Saver, Balanced, or Ultimate Performance power plan exists, and adds it if it does not exist --- win10debloat.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 741c1fc3..99e73f55 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1823,11 +1823,11 @@ $oldpower.Add_Click({ cmd /c powercfg.cpl }) $restorepower.Add_Click({ - powercfg -duplicatescheme a1841308-3541-4fab-bc81-f71556f20b4a - powercfg -duplicatescheme 381b4222-f694-41f0-9685-ff5bb260df2e - powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 - Write-Host "Restored all power plans: Balanced, High Performance, and Power Saver" - $ResultText.text = "`r`n" +"`r`n" + "Restored all power plans: Balanced, High Performance, and Power Saver" + if(!(Get-CimInstance -Name root\cimv2\power -Class Win32_PowerPlan | Where-Object ElementName -Like "Power Saver")){powercfg -duplicatescheme a1841308-3541-4fab-bc81-f71556f20b4a} + if(!(Get-CimInstance -Name root\cimv2\power -Class Win32_PowerPlan | Where-Object ElementName -Like "Balanced")){powercfg -duplicatescheme 381b4222-f694-41f0-9685-ff5bb260df2e} + if(!(Get-CimInstance -Name root\cimv2\power -Class Win32_PowerPlan | Where-Object ElementName -Like "Ultimate Performance")){powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61} + Write-Host "Restored all power plans: Power Saver, Balanced, and Ultimate Performance" + $ResultText.text = "`r`n" +"`r`n" + "Restored all power plans: Power Saver, Balanced, and Ultimate Performance" }) $NFS.Add_Click({ Enable-WindowsOptionalFeature -Online -FeatureName "ServicesForNFS-ClientOnly" -All