Azure DevOps bash script not seeing binaries on PATH

I am trying to execute a Bash script in my build pipeline that is run on a self-hosted agent. The error I am encountering is:

##[section]Starting: Bash
Task         : Bash
Description  : Run a Bash script on macOS, Linux, or Windows
Version      : 3.148.2
Author       : Microsoft Corporation
Help         : [More Information](
Generating script.
[command]C:\WINDOWS\system32\bash.exe --noprofile --norc -c pwd
Formatted command: . '/mnt/c/agent/_work/1/s/utilities/Uncrustify/'
[command]C:\WINDOWS\system32\bash.exe --noprofile --norc -c pwd
========================== Starting Command Output ===========================
[command]C:\WINDOWS\system32\bash.exe --noprofile --norc /mnt/c/agent/_work/_temp/
/mnt/c/agent/_work/1/s/utilities/Uncrustify/ line 27: uncrustify: command not found
##[error]Bash exited with code '127'.
##[error]Bash wrote one or more lines to the standard error stream.
##[section]Finishing: Bash

The script simply runs uncrustify:


# Absolute path to this script, e.g. /home/user/bin/

# Absolute path this script is in, e.g. /home/user/bin/
SCRIPTPATH="$(dirname -- "$SCRIPT")"

# Relative path from this script to the top level of this repo.

uncrustify --check -c "$GITREPO/.uncrustify.cfg" \
    $(find "$GITREPO" -name "*.c" -o -name "*.cpp" -o -name "*.cxx" -o -name "*.h" -o -name "*.hpp" -o -name "*.hxx")

The bash task in azure-pipelines.yml is:

- task: [email protected]
    filePath: 'utilities/Uncrustify/'
    displayName: 'Verify coding standard compliance'
    failOnStderr: true

I have verified that uncrustify.exe exists on the PATH, which happens to be in /mnt/c/ProgramData/chocolatey/bin. I'm not sure what I am doing wrong. Do I need to do something special to allow a bash script to call other executables that may be on the PATH?