< Back

Export-DbatoolsConfig

Mon Jan 13, 2020 10:01 am

NAME Export-DbatoolsConfig



SYNOPSIS

Exports configuration items to a Json file.





SYNTAX

Export-DbatoolsConfig -FullName <String> [-OutPath] <String> [-SkipUnchanged <Switch>] [-EnableException <Switch>]

[<CommonParameters>]



Export-DbatoolsConfig -Module <String> [[-Name] <String>] [-OutPath] <String> [-SkipUnchanged <Switch>]

[-EnableException <Switch>] [<CommonParameters>]



Export-DbatoolsConfig -Config <Sqlcollaborative.Dbatools.Configuration.Config[]> [-OutPath] <String>

[-SkipUnchanged <Switch>] [-EnableException <Switch>] [<CommonParameters>]



Export-DbatoolsConfig -ModuleName <String> [-ModuleVersion <Int>] [-Scope

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

[<CommonParameters>]





DESCRIPTION

Exports configuration items to a Json file.





PARAMETERS

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

The configuration object(s) to export.

Returned by 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 [<String>]

Select the configuration objects to export by filtering by their full name.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Module [<String>]

Select the configuration objects to export by filtering by their module name.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ModuleName [<String>]

Exports all configuration pertinent to a module to a predefined path.

Exported configuration items include all settings marked as 'ModuleExport' that have been changed from the

default value.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ModuleVersion [<Int>]

The configuration version of the module-settings to write.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Name [<String>]

Select the configuration objects to export by filtering by their name.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-OutPath [<String>]

The path (filename included) to export to.

Will fail if the folder does not exist, will overwrite the file if it exists.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



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

Which predefined path to write module specific settings to.

Only file scopes are considered.

By default it writes to the suer profile.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SkipUnchanged [<Switch>]

If set, configuration objects whose value was not changed from its original value will not be exported.

(Note: Settings that were updated with the same value as the original default will still be considered changed)



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: Friedrich Weinmann (@FredWeinmann)



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 | Export-DbatoolsConfig -OutPath '~/export.json'



Exports all current settings to json.

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



PS C:\\>Export-DbatoolsConfig -Module message -OutPath '~/export.json' -SkipUnchanged



Exports all settings of the module 'message' that are no longer the original default values to json.



RELATED LINKS

https://dbatools.io/Export-DbatoolsConfig