Thor Logo dbatools

Get-DbaInstanceList

View Source
the dbatools team + Claude
Windows, Linux, macOS

Synopsis

Returns the user-maintained list of SQL Server instances used for tab completion.

Description

Returns all SQL Server instance names from the user-maintained list that is pre-loaded
into the dbatools tab completion cache for the -SqlInstance parameter. This list allows
users to have their frequently used instances available for autocomplete in their
PowerShell terminal without needing to connect to them first.

Use Add-DbaInstanceList to add instances to the list and Remove-DbaInstanceList to
remove them.

Instances can also be pre-loaded at module import time by setting the
$env:DBATOOLS_KNOWN_INSTANCES environment variable to a comma-separated list of instance
names in your PowerShell profile.

Syntax

Get-DbaInstanceList
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaInstanceList

Returns all instance names from the user-maintained autocomplete list.

Example: 2
PS C:\> Get-DbaInstanceList | Remove-DbaInstanceList

Removes all instances from the user-maintained autocomplete list.

Outputs

System.String

Returns instance names as strings. Each instance name in the user-maintained autocomplete list is returned as a separate string object.