Update-DbaBuildReference
View SourceSynopsis
Downloads the latest SQL Server build reference database used for patch compliance and version tracking
Description
Refreshes the comprehensive SQL Server build reference database that powers Get-DbaBuild and Test-DbaBuild functions with current patch level information. This database contains detailed mappings between build numbers, service packs, cumulative updates, KB articles, release dates, and support lifecycle dates for all SQL Server versions.
DBAs use this to maintain accurate patch compliance reporting and identify outdated installations that need security updates. The function downloads the latest reference data from the dbatools project repository, ensuring you have current information about newly released patches and updated support timelines.
The reference file is stored locally and automatically updated from newer module versions, but this command ensures you get the very latest patch data between dbatools releases. You can also specify a local file path instead of downloading, useful for air-gapped environments.
Use Get-DbatoolsConfigValue -Name ‘assets.sqlbuildreference’ to see the current download URL.
Syntax
Update-DbaBuildReference
[[-LocalFile] <String>]
[-EnableException]
[<CommonParameters>]
Examples
Example: 1
PS C:\> Update-DbaBuildReference
Looks online if there is a newer version of the build reference
Example: 2
PS C:\> Update-DbaBuildReference -LocalFile \\fileserver\Software\dbatools\dbatools-buildref-index.json
Uses the given file instead of downloading the file to update the build reference
Optional Parameters
-LocalFile
Specifies the path to a local JSON build reference file to use instead of downloading from the internet.
Use this in air-gapped environments or when you need to use a specific version of the build reference data.
The file must be the dbatools-buildref-index.json format containing SQL Server build mappings and patch information.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| 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.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | False |
Outputs
None
This function does not return pipeline objects. It updates the local build reference database file and provides informational messages via Write-Message at the Output level to indicate successful updates.
The function modifies files on disk:
- If the reference file needs updating, it writes the new version to the writable location (typically in the dbatools data directory)
- Messages are written to indicate the update timestamp comparison and result To track the update result, capture Write-Message output or monitor the exit status of the command.
dbatools