commands

^

Set-DbatoolsPath

Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Set-DbatoolsPath on GitHub.
Want to see the Bill Of Health for this command? Check out 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

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

Name the path should be stored under.

Alias
Required True
Pipeline false
Default Value
-Path

The path that should be returned under the name.

Alias
Required True
Pipeline false
Default Value
-Register

Registering a path in order for it to persist across sessions.

Alias
Required True
Pipeline false
Default Value False

Optional Parameters

-Scope

The configuration scope it should be registered under.
Defaults to UserDefault.
Configuration scopes are the default locations configurations are being stored at.

Alias
Required False
Pipeline false
Default Value UserDefault