This is not an issue only when using jenkins in a slave machine. In my master machine I have the same exact issue and the problem is clearly that the PATH variable doesn't include /usr/local/bin directory for the spawned daemon that run jenkins. Setting PATH+EXTRA as Konstantin Kutsner mentioned can't be a solution because the environment variable is modified too late and that settings doesn't influence resolving of shells location.
If installed jenkins with homebrew, one workaround is to edit ~/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist to specify a full list of paths like the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Then you can restart the service or the machine.
The pipeline plugin could indeed also be improved so it attempts to resolve location fo pwsh with more fallbacks. For example it could (on unix platforms) try to find with this order:
1) Result of /usr/bin/env pwsh
2) Result of which pwsh
3) Direct path /usr/local/bin/pwsh if existing
4) Direct path /usr/bin/pwsh if existing
Of course the result can be cached so this resolution is not repeated everytime a pwsh directive is used.