< Back

Remove-PSFConfig

Sun Jan 19, 2020 6:43 pm

NAME Remove-PSFConfig



SYNOPSIS

Removes configuration items from memory.





SYNTAX

Remove-PSFConfig [[-Config] <Config[]>] [[-FullName] <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]



Remove-PSFConfig [-Module] <String> [[-Name] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

This command removes configuration items from memory.

However, not all settings can just be deleted!

A configuration item must be flagged as deletable.

This can be done using Set-PSFConfig -AllowDelete or Import-PSFConfig -AllowDelete.

Certain schema versions of configuration json may also support defining this in the file.



Limitations to flagging configuration as deletable:

> Once a configuration item has been initialized, its deletable status is frozen.

The last time it is possible to change the deletable status is during initialization.

> A setting that has been set as mandated by policy cannot be removed.



Reason for this limit:

The configuration system is designed for multiple scenarios.

Deleting settings makes sense in some, while in others it is actually detrimental.

Initialization is especially designed for the module scenario, where the module's configuration is its options

menu.

In this scenario, having a user deleting settings could lead to broken execution and unintended code paths, that

might be at odds with policies defined.





PARAMETERS

-Config <Config[]>

The configuration object to remove from memory.

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 removed from memory.



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 removed from memory.



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 deleted from

memory.



Required? false

Position? 2

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

If this switch is enabled, no actions are performed but informational messages will be displayed that explain

what would happen if the command were to run.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If this switch is enabled, you will be prompted for confirmation before executing any operations that change

state.



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



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



PS C:\\>Remove-PSFConfig -FullName 'Phase1.Step1.Server' -Confirm:$false



Deletes the setting 'Phase1.Step1.Server' from memory, assuming it exists and supports deletion.











RELATED LINKS