2

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?

1 Answer 1

3

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"
1
  • 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. Commented Mar 26, 2014 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .