From b0c999e59e9b02a9f3c4590fed58e90520f642b3 Mon Sep 17 00:00:00 2001
From: han44 <han44@illinois.edu>
Date: Fri, 13 Mar 2020 16:22:28 -0500
Subject: [PATCH] Add an option to run High Performance Power Plan

---
 smsts-post-action.ps1 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/smsts-post-action.ps1 b/smsts-post-action.ps1
index a0ef8dc..7c9a1d8 100644
--- a/smsts-post-action.ps1
+++ b/smsts-post-action.ps1
@@ -67,7 +67,10 @@ param(
 	[switch]$CMTraceForLogs,
 	
 	# Skip running Windows Updates
-	[switch]$SkipWU
+	[switch]$SkipWU,
+	
+	# Run the High Performance Power Plan script as a post-action
+	[switch]$HighPower
 )
 
 function log($msg) {
@@ -299,6 +302,12 @@ if($TeamsMsg -ne 'false') {
 	powershell.exe -executionpolicy bypass -file "$scripts\post-to-teams.ps1" -message "$TeamsMsg (_$addinfo1, *$addinfo2*_)" -title $TeamsName -webhook $TeamsWebhook > $teamslog 2>&1
 }
 
+if($HighPower) {
+    $powerplanlog = "$engritLogPath\set-high-performance-power-plan.log"
+    log "Log will go to $($powerplanlog)..."
+    powershell.exe -executionpolicy bypass -file "$scripts\set-high-performance-power-plan.ps1" > $powerplanlog 2>&1
+}
+
 # forces immediate computer reboot
 log "Rebooting..."
 shutdown /r /t 0
\ No newline at end of file
-- 
GitLab