---
title: "Set-DbatoolsPath"
description: "Configures or updates a path under a name."
url: "https://dbatools.io/Set-DbatoolsPath/"
availability: "Windows, Linux, macOS"
source: "https://github.com/dataplat/dbatools/blob/master/public/Set-DbatoolsPath.ps1"
last_updated: "2024-01-01"
---

# Set-DbatoolsPath

## Synopsis

Configures or updates a path under a name.

## Description

Configures or updates a path under a name.  
The path can be persisted using the "-Register" command.  
Paths setup like this can be retrieved using Get-DbatoolsPath.

## Syntax

```powershell
Set-DbatoolsPath -Name <String> -Path <String>
    [<CommonParameters>]

Set-DbatoolsPath -Name <String> -Path <String> -Register
    [-Scope {UserDefault | UserMandatory | SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}]
    [<CommonParameters>]

```

## Examples

### Example 1: Configures C:\temp as the current temp path

```powershell
PS C:\> Set-DbatoolsPath -Name 'temp' -Path 'C:\temp'
```

Configures C:\temp as the current temp path. (does not override $Env:TEMP !)  

### Required Parameters

##### -Name

Specifies the alias name to associate with the path for easy retrieval.  
Use descriptive names like 'backups', 'scripts', or 'logs' to organize commonly used directory paths.  
The name can be referenced later with Get-DbatoolsPath to quickly access the stored path.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | True |
| Pipeline | false |
| Default Value |  |

##### -Path

Specifies the directory path to store under the given name.  
Can be any valid file system path including network shares and mapped drives.  
Use this to centralize path management for backup locations, script directories, or output folders.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | True |
| Pipeline | false |
| Default Value |  |

##### -Register

Persists the path configuration across PowerShell sessions and module reloads.  
Without this switch, the path mapping only exists for the current session.  
Essential when setting up permanent path aliases for team environments or automated scripts.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | True |
| Pipeline | false |
| Default Value | False |

### Optional Parameters

##### -Scope

Determines where the persistent configuration is stored when using -Register.  
UserDefault stores the setting for the current user only, while other scopes affect system-wide or module-level settings.  
Choose the appropriate scope based on whether the path should be available to all users or just the current user.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value | UserDefault |

## Outputs

**None**

This command configures internal dbatools path settings but does not output any objects to the pipeline. Use Get-DbatoolsPath to retrieve the configured path values.

---

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