dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Test-DbaSqlBuild

It answers the question “is this build up to date ?”
Returns info about the specific build of a SQL instance, including the SP, the CU and the reference KB, End Of Support, wherever possible.
It adds a Compliance property as true/false, and adds details about the “targeted compliance”

Screenshots

dbatools-Test-DbaSqlBuild

Examples

Returns information about a build identified by “12.0.5540” (which is SQL 2014 with SP2 and CU4), which is not compliant as the minimum required build is “12.0.5557” (which is SQL 2014 with SP2 and CU8).

Test-DbaSqlBuild -Build “12.0.5540” -MinimumBuild “12.0.5557”

Returns information about a build identified by “12.0.5540”, making sure it is AT MOST 1 Service Pack “behind”. For that version, that identifies an SP2, means accepting as the lowest compliance version as “12.0.4110”, that identifies 2014 with SP1.

Test-DbaSqlBuild -Build “12.0.5540” -MaxBehind “1SP”

Returns information about a build identified by “12.0.5540”, making sure it is AT MOST 1 Service Pack “behind”, plus 1 CU “behind”. For that version, that identifies an SP2 and CU, rolling back 1 SP brings you to “12.0.4110”, but given the latest CU for SP1 is CU13, the target “compliant” build will be “12.0.4511”, which is 2014 with SP1 and CU12.

Test-DbaSqlBuild -Build “12.0.5540” -MaxBehind “1SP 1CU”

Returns information about a build identified by “12.0.5540”, making sure it is the latest CU release.

Test-DbaSqlBuild -Build “12.0.5540” -MaxBehind “0CU”

Same as previous, returns information about a build identified by “12.0.5540”, making sure it is the latest build available.

Test-DbaSqlBuild -Build “12.0.5540” -Latest

Same as before, but tries to fetch the most up to date index online. When the online version is newer, the local one gets overwritten.

Test-DbaSqlBuild -Build “12.00.4502” -MinimumBuild “12.0.4511” -Update

Returns information builds identified by these versions strings.

Test-DbaSqlBuild -Build “12.0.4502”,”10.50.4260″ -MinimumBuild “12.0.4511”

Integrate with other commandlets to have builds checked for all your registered servers on sqlserver2014a.

Get-DbaRegisteredServer -SqlInstance sqlserver2014a | Test-DbaSqlBuild -MinimumBuild “12.0.4511”

Author

This command was created by Simone Bizzotto. You can find Simone on Twitter.

Get-Help

From PowerShell, execute Get-Help Test-DbaSqlBuild -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaSqlBuild.ps1 on GitHub
 

Related commands