How the agent-start command is quoted for the login shell OpenSSH uses on the Windows agent (its
DefaultShell registry value). Jenkins starts the agent with a
cd "<dir>" && java ... command; && is valid in
Command Prompt and PowerShell 7 but not in Windows PowerShell 5.x.
- Auto-detect (recommended): probes the agent's shell once at launch and wraps the
command only if the shell rejects
&&. Leave this selected; the
options below are manual overrides.
- Command Prompt (cmd.exe): the OpenSSH default when no
DefaultShell is
set. Runs the command as-is (no wrapping).
- PowerShell: wraps the command as
cmd /c '<command>' so it is
handed to cmd.exe as a literal string. Needed for Windows PowerShell 5.x
(which rejects &&) and also works for PowerShell 7.
Only applies to Windows agents.