Skip to content

Get SudoPreferenceRule

dscbot edited this page Sep 20, 2026 · 1 revision

Get-SudoPreferenceRule

SYNOPSIS

Gets registered sudo preference rules.

SYNTAX

all (Default)

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

byCommand

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

DESCRIPTION

Returns all registered rules or filters rules by executable and, optionally, by the exact parameter-filter object.

EXAMPLES

EXAMPLE 1

Get-SudoPreferenceRule -Executable 'dpkg'

Returns all rules registered for dpkg.

PARAMETERS

-All

Returns every registered sudo preference rule.

Type: SwitchParameter
Parameter Sets: all
Aliases:

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

-Executable

Specifies the executable whose registered rules should be returned.

Type: String
Parameter Sets: byCommand
Aliases: Command

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

-ParameterFilterRule

Specifies the exact script block or wildcard filter to match.

Type: Object
Parameter Sets: byCommand
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

System.Object[]

NOTES

RELATED LINKS