Skip to content

Get SudoPreference

dscbot edited this page Sep 20, 2026 · 1 revision

Get-SudoPreference

SYNOPSIS

Resolves the sudo preference for a native command.

SYNTAX

Get-SudoPreference [-Executable] <String> [[-Parameters] <String[]>] 
 [<CommonParameters>]

DESCRIPTION

Returns the first global or command-specific sudo preference whose executable and argument filter match the supplied invocation.

EXAMPLES

EXAMPLE 1

Get-SudoPreference -Executable 'dpkg' -Parameters '--install', 'package.deb'

Returns the matching sudo preference, when one is registered.

PARAMETERS

-Executable

Specifies the executable for which to resolve a sudo preference.

Type: String
Parameter Sets: (All)
Aliases: Command

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

-Parameters

Specifies the native argument values evaluated by script-block filters.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
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.Collections.Hashtable

NOTES

RELATED LINKS