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

Reverts a configuration item to its default value.

Description

This command can be used to revert a configuration item to the value it was initialized with.
Generally, this amounts to reverting it to its default value.

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, from which configurations should be reset.
Used in conjunction with the -Name parameter to filter a specific set of items.

Alias
Required True
Pipeline false
Default Value

Optional Parameters

-ConfigurationItem

A configuration object as returned by Get-DbatoolsConfig.

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

The full name of the setting to reset, offering the maximum of precision.

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

Used in conjunction with the -Module parameter to select which settings to reset using wildcard comparison.

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