How do I pass parameters that contain spaces?

453 Views Asked by At

I want to pass the following "javaoptions" containing a file path with spaces within --params.

--params "'/javaoptions:-Dwebdriver.jx.browser="C:/Program Files (x86)/TestNav/TestNav.exe"'"

1

There are 1 best solutions below

3
On BEST ANSWER

This is how you can get it to work:

choco install -y selenium --params "'/role:node /hub:http://localhost:4444 /capabilitiesJson:$capabilitiesJson /autostart /maxSession:1 /javaoptions:""-Dwebdriver.jx.browser=\`"C:\PROGRA~2\TestNav\TestNav.exe\`"""'" --force -d

Note that $capabilitiesJson is being interpolated properly.