Configuration

Show-sqmBackupExcludeForm

Opens a dark-themed WinForms dialog to interactively manage the backup exclusion list — displays all databases from the instance, lets the user include or exclude individual databases, and writes the selection back to the sqmBackupExclude table.

Module: sqmSQLTool
Requires: dbatools
ShouldProcess: No
Output: None (modal dialog)

Execution Flow

START 1. Get-DbaDatabase → load all databases from SqlInstance 2. Invoke-DbaQuery → read current sqmBackupExclude entries 3. Build WinForms dialog (dark VS palette #1e1e1e / #252526) 4. Pre-check excluded databases in CheckedListBox 5. Show modal dialog — user checks/unchecks databases User clicked OK? return (Cancel) 6. Truncate sqmBackupExclude → insert checked databases DONE
The form uses the Visual Studio dark color palette (#1e1e1e background, #252526 panel, #007acc accent) to match the sqmSQLTool main GUI. Changes are saved only when the user clicks OK — closing the window or clicking Cancel leaves the exclusion table unchanged. See also: Sync-sqmBackupExcludeTable to propagate the list to secondary instances.

Parameters

ParameterTypeRequiredDescription
-SqlInstanceStringOptionalSQL Server instance. Default: $env:COMPUTERNAME.
-SqlCredentialPSCredentialOptionalSQL authentication credential.

Return Value

No pipeline output. The function writes directly to the sqmBackupExclude table on user confirmation.

Examples

Example 1 — Open exclusion editor for local instance

Show-sqmBackupExcludeForm

Example 2 — Remote instance with SQL authentication

$cred = Get-Credential
Show-sqmBackupExcludeForm -SqlInstance "SQL01" -SqlCredential $cred