Remove-PackageUpdateRule
For AI agents: a documentation index is available at /llms.txt; a markdown version of this page is available at /docs/commands/remove-packageupdaterule/index.md.
SYNOPSIS
Removes one or more custom update-handling rules from the package update configuration.
SYNTAX
ById (Default)
Remove-PackageUpdateRule -Id <int[]> [-Force] [-PassThru] [-SettingObject <Configuration>] [-WhatIf]
[-Confirm] [<CommonParameters>]
ByInputObject
Remove-PackageUpdateRule -InputObject <ModuleRule[]> [-Force] [-PassThru]
[-SettingObject <Configuration>] [-WhatIf] [-Confirm] [<CommonParameters>]
ALIASES
This cmdlet has the following aliases,
DESCRIPTION
Removes existing custom rules that define how specific PowerShell modules should be handled during update checks and reporting. The command can remove rules by rule Id, by piping in rule objects from Get-PackageUpdateRule, or by updating a settings object that contains the rule collection.
When rules are removed, the updated configuration is written back to the settings file so the change persists. Use -PassThru to return the removed rule objects to the pipeline.
EXAMPLES
EXAMPLE 1
PS C:\> Get-PackageUpdateRule | Remove-PackageUpdateRule
Removes all custom update rules from the current module settings.
EXAMPLE 2
PS C:\> Remove-PackageUpdateRule -Id 12
Removes the custom rule with Id 12 from the current configuration.
EXAMPLE 3
$rules = Get-PackageUpdateRule -Name "Microsoft.PowerShell.Utility"
PS C:\> $rules | Remove-PackageUpdateRule -PassThru
Removes the matching rules and returns the removed rule objects to the pipeline.
EXAMPLE 4
$settings = Get-PackageUpdateSetting
PS C:\> Remove-PackageUpdateRule -Id 3 -SettingObject $settings -Force
Removes a specific rule without prompting and writes the updated settings back to disk.
PARAMETERS
-Confirm
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Force
Suppresses the confirmation prompt and removes the rule immediately.
Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Id
The Id of the rule to remove. Accepts one or more rule identifiers.
Type: Int32[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ById
Position: Named
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-InputObject
One or more rule objects to remove. These are typically returned by Get-PackageUpdateRule.
Type: ModuleRule[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByInputObject
Position: Named
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-PassThru
Returns the removed rule object(s) to the pipeline for further processing.
Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SettingObject
The configuration object that contains the rule collection. If this parameter is not supplied, the command uses the current module settings from Get-PackageUpdateSetting.
Type: Configuration
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
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.
Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.Int32[]
PackageUpdate.ModuleRule[]
PackageUpdate.Configuration
OUTPUTS
PackageUpdate.ModuleRule
NOTES
Version : 1.1.0.0 Author : Andi Bellstedt Date : 2026-06-21 Keywords : PackageUpdateInfo, Update, Module, Rule