Skip to content

Get‑ChocolateyCommand

dscbot edited this page Oct 23, 2025 · 1 revision

SYNOPSIS

Get the Chocolatey command executable.

SYNTAX

Get-ChocolateyCommand [[-InstallDir] <String>] [-Force] 
 [<CommonParameters>]

DESCRIPTION

This function retrieves the path to the Chocolatey command executable (choco.exe).

EXAMPLES

EXAMPLE 1

Get-ChocolateyCommand -InstallDir 'C:\ProgramData\chocolatey' -Force

PARAMETERS

-Force

Whether to force re-evaluation of the Chocolatey command path.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-InstallDir

The installation directory of Chocolatey.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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

NOTES

RELATED LINKS

Clone this wiki locally