< Back

Test-DbaPowerPlan

Mon Jan 13, 2020 6:15 pm

NAME Test-DbaPowerPlan



SYNOPSIS

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





SYNTAX

Test-DbaPowerPlan [[-ComputerName] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>] [[-Credential]

<Pscredential>] [[-CustomPowerPlan] <String>] [[-InputObject] <System.Management.Automation.PSObject[]>]

[-EnableException <Switch>] [<CommonParameters>]





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/wi ... rocessors/





PARAMETERS

-ComputerName [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Credential [<Pscredential>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-CustomPowerPlan [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-InputObject [<System.Management.Automation.PSObject[]>]

Enables piping from Get-DbaPowerPlan



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: PowerPlan

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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".



RELATED LINKS

https://dbatools.io/Test-DbaPowerPlan