< Back

Show-DbaDbList

Mon Jan 13, 2020 5:47 pm

NAME Show-DbaDbList



SYNOPSIS

Shows a list of databases in a GUI.





SYNTAX

Show-DbaDbList [-SqlInstance] <DbaInstanceParameter> [[-SqlCredential] <Pscredential>] [[-Title] <String>]

[[-Header] <String>] [[-DefaultDb] <String>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

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

returns null.





PARAMETERS

-DefaultDb [<String>]

Specify a database to have selected when the window appears.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Header [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlInstance [<DbaInstanceParameter>]

The target SQL Server instance or instances..



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Title [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Database, FileSystem

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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.



RELATED LINKS

https://dbatools.io/Show-DbaDbList