Thor Logo dbatools

Remove-DbaInstanceList

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

Synopsis

Removes one or more SQL Server instances from the user-maintained autocomplete list.

Description

Removes SQL Server instance names from the user-maintained list that is pre-loaded into
the dbatools tab completion cache for the -SqlInstance parameter. The instances are
removed from the stored configuration and from the current session’s autocomplete cache.

Use Add-DbaInstanceList to add instances to the list and Get-DbaInstanceList to view
the current list.

Syntax

Remove-DbaInstanceList
    [-SqlInstance] <String[]>
    [-Register]
    [[-Scope] {UserDefault | UserMandatory | SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Remove-DbaInstanceList -SqlInstance "sql01"

Removes sql01 from the autocomplete instance list.

Example: 2
PS C:\> Remove-DbaInstanceList -SqlInstance "sql01", "sql02\dev" -Register

Removes two instances from the list and persists the change across PowerShell sessions.

Example: 3
PS C:\> Get-DbaInstanceList | Remove-DbaInstanceList -Register

Removes all instances from the user-maintained autocomplete list and persists the change.

Required Parameters

-SqlInstance

The SQL Server instance name or names to remove from the autocomplete list.
Accepts pipeline input.

PropertyValue
Alias
RequiredTrue
Pipelinetrue (ByValue, ByPropertyName)
Default Value

Optional Parameters

-Register

Persists the updated instance list to disk after removal so the change is available in
future PowerShell sessions. Without this switch, the removal only affects the stored
configuration for the current session.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueFalse
-Scope

Determines where the persistent configuration is stored when using -Register.
UserDefault stores the setting for the current user only.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueUserDefault
-WhatIf
PropertyValue
Aliaswi
RequiredFalse
Pipelinefalse
Default Value
-Confirm
PropertyValue
Aliascf
RequiredFalse
Pipelinefalse
Default Value

Outputs

None

This command updates the stored configuration but does not output any objects to the pipeline. Use Get-DbaInstanceList to retrieve the current configured instance names.