---
title: "Remove-DbaInstanceList"
description: "Removes one or more SQL Server instances from the user-maintained autocomplete list."
url: "https://dbatools.io/Remove-DbaInstanceList/"
availability: "Windows, Linux, macOS"
tags: ["TabCompletion", "Autocomplete"]
author: "the dbatools team + Claude"
source: "https://github.com/dataplat/dbatools/blob/master/public/Remove-DbaInstanceList.ps1"
last_updated: "2024-01-01"
---

# Remove-DbaInstanceList

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

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

```

## Examples

### Example 1: Removes sql01 from the autocomplete instance list

```powershell
PS C:\> Remove-DbaInstanceList -SqlInstance "sql01"
```

### Example 2: Removes two instances from the list and persists the change across PowerShell sessions

```powershell
PS C:\> Remove-DbaInstanceList -SqlInstance "sql01", "sql02\dev" -Register
```

### Example 3: Removes all instances from the user-maintained autocomplete list and persists the change

```powershell
PS C:\> Get-DbaInstanceList | Remove-DbaInstanceList -Register
```

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

---

Part of [dbatools](https://dbatools.io/), a free and open source PowerShell module for SQL Server administration. Full command index: https://dbatools.io/commands/
