commands

^

Save-DbaDiagnosticQueryScript

Author Andre Kamman (@AndreKamman), https://andrekamman.com
Availability Windows, Linux, macOS

 

Synopsis

Save-DbaDiagnosticQueryScript downloads the most recent version of all Glenn Berry DMV scripts

Description

The dbatools module will have the diagnostic queries pre-installed. Use this only to update to a more recent version or specific versions.

This function is mainly used by Invoke-DbaDiagnosticQuery, but can also be used independently to download the Glenn Berry DMV scripts.

Use this function to pre-download the scripts from a device with an Internet connection.

The function Invoke-DbaDiagnosticQuery will try to download these scripts automatically, but it obviously needs an internet connection to do that.

Syntax

Save-DbaDiagnosticQueryScript
    [[-Path] <FileInfo>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Save-DbaDiagnosticQueryScript -Path c:\temp

Downloads the most recent version of all Glenn Berry DMV scripts to the specified location.
If Path is not specified, the "My Documents" location will be used.

Optional Parameters

-Path

Specifies the path to the output

Alias
Required False
Pipeline false
Default Value [Environment]::GetFolderPath("mydocuments")
-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.

Alias
Required False
Pipeline false
Default Value False

 

Want to see the source code for this command? Check out Save-DbaDiagnosticQueryScript on GitHub.
Want to see the Bill Of Health for this command? Check out Save-DbaDiagnosticQueryScript.