commands

^

Test-DbaPowerPlan

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows only

 

Synopsis

Checks the Power Plan settings for compliance with best practices, which recommend High Performance for SQL Server.

Description

Checks the Power Plan settings on a computer against best practices recommendations. If one server is checked, only $true or $false is returned. If multiple servers are checked, each server's name and an isBestPractice field are returned.

References: https://support.microsoft.com/en-us/kb/2207548 http://www.sqlskills.com/blogs/glenn/windows-power-plan-effects-on-newer-intel-processors/

Syntax

Test-DbaPowerPlan
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [[-CustomPowerPlan] <String>]
    [[-InputObject] <PSObject[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Test-DbaPowerPlan -ComputerName sqlserver2014a

Checks the Power Plan settings for sqlserver2014a and indicates whether or not it complies with best practices.

Example: 2
PS C:\> Test-DbaPowerPlan -ComputerName sqlserver2014a -CustomPowerPlan 'Maximum Performance'

Checks the Power Plan settings for sqlserver2014a and indicates whether or not it is set to the custom plan "Maximum Performance".

Optional Parameters

-ComputerName

The server(s) to check Power Plan settings on.

Alias
Required False
Pipeline true (ByValue)
Default Value $env:COMPUTERNAME
-Credential

Specifies a PSCredential object to use in authenticating to the server(s), instead of the current user account.

Alias
Required False
Pipeline false
Default Value
-CustomPowerPlan

If your organization uses a custom power plan that's considered best practice, specify it here.

Alias
Required False
Pipeline false
Default Value
-InputObject

Enables piping from Get-DbaPowerPlan

Alias
Required False
Pipeline true (ByValue)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False

 

Want to see the source code for this command? Check out Test-DbaPowerPlan on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaPowerPlan.