Remove-DbaInstanceList
View SourceSynopsis
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.
| Property | Value |
|---|---|
| Alias | |
| Required | True |
| Pipeline | true (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.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | False |
-Scope
Determines where the persistent configuration is stored when using -Register.
UserDefault stores the setting for the current user only.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | UserDefault |
-WhatIf
| Property | Value |
|---|---|
| Alias | wi |
| Required | False |
| Pipeline | false |
| Default Value |
-Confirm
| Property | Value |
|---|---|
| Alias | cf |
| Required | False |
| Pipeline | false |
| 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.
dbatools