Thor Logo dbatools

Save-DbaCommunitySoftware

View Source
Andreas Jordan, @JordanOrdix
Windows, Linux, macOS

Synopsis

Downloads and caches popular SQL Server community tools from GitHub for use by dbatools installation commands

Description

Downloads and extracts popular SQL Server community tools from GitHub repositories to maintain a local cache used by dbatools installation commands.
This function automatically manages the acquisition and versioning of essential DBA script collections, eliminating the need to manually download and organize multiple tool repositories.
It’s called internally by Install-Dba*, Update-Dba*, and Invoke-DbaAzSqlDbTip commands when they need to access the latest versions of community tools.

Supports both online downloads directly from GitHub and offline installations using local zip files, making it suitable for restricted network environments.
The function handles version detection, directory structure normalization, and maintains consistent file organization across different tool repositories.

For environments without internet access, you can download zip files from the following URLs on another computer, transfer them to the target system, and use -LocalFile to update the local cache:

Syntax

Save-DbaCommunitySoftware
    [[-Software] <String>]
    [[-Branch] <String>]
    [[-LocalFile] <String>]
    [[-Url] <String>]
    [[-LocalDirectory] <String>]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Save-DbaCommunitySoftware -Software MaintenanceSolution

Updates the local cache of Ola Hallengren’s Solution objects.

Example: 2
PS C:\> Save-DbaCommunitySoftware -Software FirstResponderKit -LocalFile \\fileserver\Software\SQL-Server-First-Responder-Kit-20211106.zip

Updates the local cache of the First Responder Kit based on the given file.

Optional Parameters

-Software

Name of the software to download.
Options include:

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
Accepted ValuesMaintenanceSolution,FirstResponderKit,DarlingData,SQLWATCH,WhoIsActive,DbaMultiTool,AzSqlTips
-Branch

Specifies which branch or version to download from the GitHub repository. Defaults to master or main depending on the repository.
Use this when you need a specific development branch or to override default versioning. Only applies to branch-based downloads like MaintenanceSolution, FirstResponderKit, DarlingData, and
DbaMultiTool.
For SQLWATCH, use ‘prerelease’ or ‘pre-release’ to get preview versions instead of stable releases.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-LocalFile

Specifies the path to a local zip file or SQL script to install from instead of downloading from GitHub.
Use this for offline environments or when you have a specific version already downloaded. Accepts zip archives for all tools, plus individual SQL files for WhoIsActive (sp_WhoIsActive.sql) and
AzSqlTips (get-sqldb-tips.sql).
Essential for air-gapped systems where direct internet access is not available.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-Url

Specifies a custom URL to download the software archive from instead of using the automatic GitHub URLs.
Use this when you need to download from a forked repository, specific release, or alternative hosting location. Overrides the default URL generation that occurs when using the Software parameter.
Must point to a downloadable zip file containing the community tools.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-LocalDirectory

Specifies a custom directory path where the community software will be extracted and cached.
Use this when you need to store the tools in a non-standard location instead of the default dbatools data directory. Overrides the automatic path generation based on the Software parameter.
Useful for custom cache locations or when working with multiple versions of the same tool.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
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.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueFalse
-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

PropertyValue
Aliaswi
RequiredFalse
Pipelinefalse
Default Value
-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

PropertyValue
Aliascf
RequiredFalse
Pipelinefalse
Default Value