commands

^

Reset-DbatoolsConfig

Author Friedrich Weinmann (@FredWeinmann)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Reset-DbatoolsConfig on GitHub.
Want to see the Bill Of Health for this command? Check out Reset-DbatoolsConfig.

Synopsis

Resets dbatools module configuration settings back to their default values.

Description

Restores dbatools configuration settings to their original default values, useful when troubleshooting connectivity issues, fixing misconfigured connection strings, or starting fresh after environment changes. This is particularly helpful when dbatools settings have been customized for specific environments and you need to restore the baseline behavior.

The function can reset individual configuration items, all settings within a specific module, or all dbatools configuration settings at once. This saves you from manually tracking down and reconfiguring individual settings.

In order for a reset to be possible, two conditions must be met:

  • The setting must have been initialized.
  • The setting cannot have been enforced by policy.

Syntax

Reset-DbatoolsConfig
    [-ConfigurationItem <Config[]>]
    [-FullName <String[]>]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Reset-DbatoolsConfig -Module <String>
    [-Name <String>]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Reset-DbatoolsConfig -Module MyModule

Resets all configuration items of the MyModule to default.

Example: 2
PS C:\> Get-DbatoolsConfig | Reset-DbatoolsConfig

Resets ALL configuration items to default.

Example: 3
PS C:\> Reset-DbatoolsConfig -FullName MyModule.Group.Setting1

Resets the configuration item named 'MyModule.Group.Setting1'.

Required Parameters

-Module

The name of the module whose configuration settings should be reset (e.g., 'dbatools', 'sql', 'connection').
Use this when you want to reset all settings within a specific functional area, such as resetting all connection-related settings after environment changes.

Alias
Required True
Pipeline false
Default Value

Optional Parameters

-ConfigurationItem

One or more configuration objects as returned by Get-DbatoolsConfig.
Use this when you want to reset specific configuration items that you've already identified through Get-DbatoolsConfig, allowing for precise control over which settings get reset.

Alias
Required False
Pipeline true (ByValue)
Default Value
-FullName

The full qualified name of a specific configuration setting to reset (e.g., 'dbatools.Connection.EncryptConnection').
Use this when you know the exact setting name and want to reset just that one item, providing the most precise targeting of configuration changes.

Alias
Required False
Pipeline true (ByValue)
Default Value
-Name

A wildcard pattern to match configuration setting names within the specified module (defaults to "" for all settings).
Use this with the -Module parameter to selectively reset settings, such as using "Encrypt
" to reset only encryption-related settings within a module.

Alias
Required False
Pipeline false
Default Value *
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False
-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

Alias wi
Required False
Pipeline false
Default Value
-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

Alias cf
Required False
Pipeline false
Default Value