< Back

Export-PSFConfig

Sun Jan 19, 2020 6:39 pm

NAME Export-PSFConfig



SYNOPSIS

Exports configuration items to a Json file.





SYNTAX

Export-PSFConfig [-FullName] <String> [-OutPath] <String> [-SkipUnchanged] [-EnableException] [<CommonParameters>]



Export-PSFConfig [-Module] <String> [[-Name] <String>] [-OutPath] <String> [-SkipUnchanged] [-EnableException]

[<CommonParameters>]



Export-PSFConfig [-Config] <Config[]> [-OutPath] <String> [-SkipUnchanged] [-EnableException] [<CommonParameters>]



Export-PSFConfig -ModuleName <String> [-ModuleVersion <Int32>] [-Scope {UserDefault | UserMandatory |

SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}] [-SkipUnchanged]

[-EnableException] [<CommonParameters>]





DESCRIPTION

Exports configuration items to a Json file.





PARAMETERS

-FullName <String>

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



Required? true

Position? 1

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? true

Position? 1

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? 2

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-Config <Config[]>

The configuration object(s) to export.

Returned by Get-PSFConfig.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

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? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ModuleVersion <Int32>

The configuration version of the module-settings to write.



Required? false

Position? named

Default value 1

Accept pipeline input? false

Accept wildcard characters? false



-Scope

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 FileUserShared

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? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SkipUnchanged [<SwitchParameter>]

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 False

Accept pipeline input? false

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

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 False

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



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



PS C:\\>Get-PSFConfig | Export-PSFConfig -OutPath '~/export.json'



Exports all current settings to json.









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



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



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











RELATED LINKS