|Author||Andre Kamman (@AndreKamman), andrekamman.com|
|Availability||Windows, Linux, macOS|
Save-DbaDiagnosticQueryScript downloads the most recent version of all Glenn Berry DMV scripts
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.
Save-DbaDiagnosticQueryScript [[-Path] <FileInfo>] [-EnableException] [<CommonParameters>]
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.
Specifies the path to the output
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.