Commit 73e4a9d0 authored by Stefan Scherer's avatar Stefan Scherer Committed by GitHub

Merge pull request #50 from basictheprogram/issue-49

WIP https://github.com/StefanScherer/packer-windows/issues/49
parents 20a298f0 29ce6aee
Try {
Write-Output "Set power plan to high performance"
$HighPerf = powercfg -l | %{if($_.contains("High performance")) {$_.split()[3]}}
# $HighPerf cannot be $null, we try activate this power profile with powercfg
#
if ($HighPerf -eq $null)
{
throw "Error: HighPerf is null"
}
$CurrPlan = $(powercfg -getactivescheme).split()[3]
if ($CurrPlan -ne $HighPerf) {powercfg -setactive $HighPerf}
} Catch {
Write-Warning -Message "Unable to set power plan to high performance"
Write-Warning $Error[0]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment