< Back

Register-PSFConfig

Sun Jan 19, 2020 6:42 pm

NAME Register-PSFConfig



SYNOPSIS

Registers an existing configuration object in registry.





SYNTAX

Register-PSFConfig [[-Config] <Config[]>] [[-FullName] <String[]>] [-Scope {UserDefault | UserMandatory |

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

[<CommonParameters>]



Register-PSFConfig [-Module] <String> [[-Name] <String>] [-Scope {UserDefault | UserMandatory | SystemDefault |

SystemMandatory | FileUserLocal | FileUserShared | FileSystem}] [-EnableException] [<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 <Config[]>

The configuration object to write to registry.

Can be retrieved using Get-PSFConfig.



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-FullName <String[]>

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



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Module <String>

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



Required? true

Position? 1

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

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-Scope

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 UserDefault

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 psframework.message.* | Register-PSFConfig



Retrieves all configuration items that that start with psframework.message. and registers them in registry for the

current user.









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



PS C:\\>Register-PSFConfig -FullName "psframework.developer.mode.enable" -Scope SystemDefault



Retrieves the configuration item "psframework.developer.mode.enable" and registers it in registry as the default

setting for all users on this machine.









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



PS C:\\>Register-PSFConfig -Module MyModule -Scope SystemMandatory



Retrieves all configuration items of the module MyModule, then registers them in registry to enforce them for all

users on the current system.











RELATED LINKS