Skip to content

Remove SudoPreferenceRule

dscbot edited this page Sep 20, 2026 · 1 revision

Remove-SudoPreferenceRule

SYNOPSIS

Removes registered sudo preference rules.

SYNTAX

ByValue

Remove-SudoPreferenceRule -Executable <String> -ParameterFilterRule <Object>
 [<CommonParameters>]

ByIndex

Remove-SudoPreferenceRule [<CommonParameters>]

All

Remove-SudoPreferenceRule [-All] [<CommonParameters>]

DESCRIPTION

Removes rules by executable and filter, by internal index, or clears every registered rule.

EXAMPLES

EXAMPLE 1

Remove-SudoPreferenceRule -Executable 'dpkg' -ParameterFilterRule '*'

Removes wildcard sudo rules registered for dpkg.

PARAMETERS

-All

Removes every registered sudo preference rule.

Type: SwitchParameter
Parameter Sets: All
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Executable

Specifies the executable whose matching rules should be removed.

Type: String
Parameter Sets: ByValue
Aliases: Command

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ParameterFilterRule

Specifies the exact script block or wildcard filter to remove.

Type: Object
Parameter Sets: ByValue
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS