複数のサーバーマシンで "高性能" powerplanを設定する必要があります。私は、サーバー上でこれを1つずつ実行するときにうまく動作している次のスクリプトを持っています。Powershellを使用して複数のサーバーで電源プランを設定する
セットPowerPlan「高パフォーマンス」電源プランを再帰的にすべてのサーバーに設定されているように、このスクリプトにサーバのリストを渡す方法
function Set-PowerPlan {
[CmdletBinding(SupportsShouldProcess = $True)]
param (
[ValidateSet("High performance", "Balanced", "Power saver")]
[ValidateNotNullOrEmpty()]
[string] $PreferredPlan = "High Performance"
)
Write-Host "Setting power plan to `"$PreferredPlan`""
$guid = (Get-WmiObject -Class Win32_PowerPlan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.ToString()
$regex = [regex]"{(.*?)}$"
$plan = $regex.Match($guid).groups[1].value
powercfg -S $plan
$Output = "Power plan set to "
$Output += "`"" + ((Get-WmiObject -Class Win32_PowerPlan -Namespace root\cimv2\power -Filter "IsActive='$True'").ElementName) + "`""
Write-Host $Output
}
? 私を助けてください。