commands

^

Show-DbaDbList

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows only

 

Synopsis

Shows a list of databases in a GUI.

Description

Shows a list of databases in a GUI. Returns a string holding the name of the selected database. Hitting cancel returns null.

Syntax

Show-DbaDbList
    [-SqlInstance] <DbaInstanceParameter>
    [[-SqlCredential] <PSCredential>]
    [[-Title] <String>]
    [[-Header] <String>]
    [[-DefaultDb] <String>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Show-DbaDbList -SqlInstance sqlserver2014a

Shows a GUI list of databases using Windows Authentication to connect to the SQL Server. Returns a string of the selected database.

Example: 2
PS C:\> Show-DbaDbList -SqlInstance sqlserver2014a -SqlCredential $cred

Shows a GUI list of databases using SQL credentials to connect to the SQL Server. Returns a string of the selected database.

Example: 3
PS C:\> Show-DbaDbList -SqlInstance sqlserver2014a -DefaultDb master

Shows a GUI list of databases using Windows Authentication to connect to the SQL Server. The "master" database will be selected when the lists shows. Returns a string of the selected database.

Required Parameters

-SqlInstance

The target SQL Server instance or instances..

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Title

Title of the window being displayed. Default is "Select Database".

Alias
Required False
Pipeline false
Default Value Select Database

Header text displayed above the database listing. Default is "Select the database:".

Alias
Required False
Pipeline false
Default Value Select the database:
-DefaultDb

Specify a database to have selected when the window appears.

Alias
Required False
Pipeline false
Default Value
-EnableException

By default in most of our commands, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This command, however, gifts you with "sea of red" exceptions, by default, because it is useful for advanced scripting. Using this switch turns our "nice by default" feature on which makes errors into pretty warnings.

Alias
Required False
Pipeline false
Default Value False

 

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