1

I am using a program called sonar-runner that you execute from the commandline, and you can pass optional parameters. For example in the normal windows commandline tool a call may look something like:

sonar-runner -Dsonar.dryRun=true -Dsonar.inclusions=src/main/java/com/schoen/Test.java

When I try running that same command from Powershell I get the following error:

ERROR: Unrecognized option: .dryRun=true
INFO:
INFO: usage: sonar-runner [options]
INFO:
INFO: Options:
INFO:  -D,--define <arg>     Define property
INFO:  -e,--errors           Produce execution error messages
INFO:  -h,--help             Display help information
INFO:  -v,--version          Display version information
INFO:  -X,--debug            Produce execution debug output

It is essentially parsing the parameters incorrectly, breaking them appart on periods instead of spaces. Is there away to work around this?

2

Wrap them in quotes so that powershell does not try to parse it:

sonar-runner.exe "-Dsonar.dryRun=true" "-Dsonar.inclusions=src/main/java/com/schoen/Test.java"
  • Thanks, that did the trick for the most part. I had to wrap each -D... section in quotes for it to work. I suggested an edit to indicate that in your answer. – Jacob Schoen Mar 26 '14 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.