< Back

Register-DbatoolsConfig

Mon Jan 13, 2020 1:08 pm

NAME Register-DbatoolsConfig



SYNOPSIS

Registers an existing configuration object in registry.





SYNTAX

Register-DbatoolsConfig [-Config <Sqlcollaborative.Dbatools.Configuration.Config[]>] [-FullName <System.String[]>]

[-Scope <Sqlcollaborative.Dbatools.Configuration.ConfigScope>] [-EnableException <Switch>] [<CommonParameters>]



Register-DbatoolsConfig [-Module] <String> [[-Name] <String>] [-Scope

<Sqlcollaborative.Dbatools.Configuration.ConfigScope>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-Config [<Sqlcollaborative.Dbatools.Configuration.Config[]>]

The configuration object to write to registry.

Can be retrieved using Get-DbatoolsConfig.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

This parameters disables user-friendly warnings and enables the throwing of exceptions.

This is less user friendly, but allows catching exceptions in calling scripts.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-FullName [<System.String[]>]

The full name of the setting to be written to registry.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Module [<String>]

The name of the module, whose settings should be written to registry.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Name [<String>]

Default: "*"

Used in conjunction with the -Module parameter to restrict the number of configuration items written to

registry.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Scope [<Sqlcollaborative.Dbatools.Configuration.ConfigScope>]

Default: UserDefault

Who will be affected by this export how? Current user or all? Default setting or enforced?

Legal values: UserDefault, UserMandatory, SystemDefault, SystemMandatory



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Module

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- EXAMPLE 1 --------------------------



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.

-------------------------- EXAMPLE 2 --------------------------



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.

-------------------------- EXAMPLE 3 --------------------------



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.



RELATED LINKS

https://dbatools.io/Register-DbatoolsConfig