< Back

Get-DbaBuildReference

Mon Jan 13, 2020 10:25 am

NAME Get-DbaBuildReference



SYNOPSIS

Returns SQL Server Build infos on a SQL instance





SYNTAX

Get-DbaBuildReference [[-Build] <System.Version[]>] [[-Kb] <System.String[]>] [[-MajorVersion] <String>]

[[-ServicePack] <String>] [[-CumulativeUpdate] <String>] [[-SqlInstance]

<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>] [[-SqlCredential] <Pscredential>] [-Update <Switch>]

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





DESCRIPTION

Returns info about the specific build of a SQL instance, including the SP, the CU and the reference KB, wherever

possible.



It also includes End Of Support dates as specified on Microsoft Life Cycle Policy





PARAMETERS

-Build [<System.Version[]>]

Instead of connecting to a real instance, pass a string identifying the build to get the info back.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-CumulativeUpdate [<String>]

Get a KB information based on SQL Server Cumulative Update version.

Examples: CU0 | CU13 | CU0



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



-Kb [<System.String[]>]

Get a KB information based on its number. Supported format: KBXXXXXX, or simply XXXXXX.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-MajorVersion [<String>]

Get a KB information based on SQL Server version. Can be refined further by -ServicePack and -CumulativeUpdate

parameters.

Examples: SQL2008 | 2008R2 | 2016



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ServicePack [<String>]

Get a KB information based on SQL Server Service Pack version. Can be refined further by -CumulativeUpdate

parameter.

Examples: SP0 | 2 | RTM



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).



Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory -

Integrated are all supported.



For MFA support, please use Connect-DbaInstance.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



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

Target any number of instances, in order to return their build state.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Update [<Switch>]

Looks online for the most up to date reference, replacing the local one.



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: SqlBuild

Author: Simone Bizzotto (@niphold) | Friedrich Weinmann (@FredWeinmann)



Website: https://dbatools.io

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

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



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-DbaBuildReference -Build "12.00.4502"



Returns information about a build identified by "12.00.4502" (which is SQL 2014 with SP1 and CU11)

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-DbaBuildReference -Build "12.00.4502" -Update



Returns information about a build trying to fetch the most up to date index online. When the online version is

newer, the local one gets overwritten

-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-DbaBuildReference -Build "12.0.4502","10.50.4260"



Returns information builds identified by these versions strings

-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-DbaRegServer -SqlInstance sqlserver2014a | Get-DbaBuildReference



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



RELATED LINKS

https://dbatools.io/Get-DbaBuildReference