Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Register-DbatoolsConfig on GitHub.
Want to see the Bill Of Health for this command? Check out Register-DbatoolsConfig.
Registers an existing configuration object in registry.
Registers an existing configuration object in registry.
This allows simple persisting of settings across powershell consoles.
It also can be used to generate a registry template, which can then be used to create policies.
Register-DbatoolsConfig
[-Config <Config[]>]
[-FullName <String[]>]
[-Scope {UserDefault | UserMandatory | SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}]
[-EnableException]
[<CommonParameters>]
Register-DbatoolsConfig
[-Module] <String>
[[-Name] <String>]
[-Scope {UserDefault | UserMandatory | SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbatoolsConfig message.style.* | Register-DbatoolsConfig
Retrieves all configuration items that that start with message.style. and registers them in registry for the current user.
PS C:\> Register-DbatoolsConfig -FullName "message.consoleoutput.disable" -Scope SystemDefault
Retrieves the configuration item "message.consoleoutput.disable" and registers it in registry as the default setting for all users on this machine.
PS C:\> Register-DbatoolsConfig -Module Message -Scope SystemMandatory
Retrieves all configuration items of the module Message, then registers them in registry to enforce them for all users on the current system.
PS C:\> Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -PassThru | Register-DbatoolsConfig
Set the "sql.connection.trustcert" configuration to be $true, and then use the -PassThru parameter
to be able to pipe the output and register them in registry for the current user.
The name of the module, whose settings should be written to registry.
Alias | |
Required | True |
Pipeline | false |
Default Value |
The configuration object to write to registry.
Can be retrieved using Get-DbatoolsConfig.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
The full name of the setting to be written to registry.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
Default: "*"
Used in conjunction with the -Module parameter to restrict the number of configuration items written to registry.
Alias | |
Required | False |
Pipeline | false |
Default Value | * |
Default: UserDefault
Who will be affected by this export how? Current user or all? Default setting or enforced?
Legal values: UserDefault, UserMandatory, SystemDefault, SystemMandatory
Alias | |
Required | False |
Pipeline | false |
Default Value | UserDefault |
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 |