Describe the bug
It is likely that a command-line parsing problem has occurred after 4.8.3.
(4.8.2 is all fine.)
To Reproduce
Cobertura report will be expected by the command-line below:
(Under PowerShell)
. 'C:workReportGenerator.4.8.3toolsnet47ReportGenerator.exe' "-reports:C:workCoverages***.xml" "-targetdir:C:workoutput" "-reporttypes:Cobertura"
But HTML report will be generated.
In 4.8.3 I had to fix an issue regarding command line parsing (see #401).
This could be a not intended side effect.
However I'm not able to reproduce the issue. I'm also using Powershell.
Can you please execute again and check the log output in your console.
For me it's:
. 'ReportGenerator.exe' "-reports:Coverage*.xml" "-targetdir:cobertura" "-reporttypes:Cobertura"
2020-12-30T09:49:56: Arguments
2020-12-30T09:49:56: -reports:Coverage*.xml
2020-12-30T09:49:56: -targetdir:cobertura
2020-12-30T09:49:56: -reporttypes:Cobertura
2020-12-30T09:49:56: Writing report file 'cobertura\Cobertura.xml'
2020-12-30T09:49:56: Report generation took 0,2 seconds
Thank you for your trying.
And sorry, the procedure I wrote was not precise.
The complete script that can reproduce the problem is below:
$reportGeneratorPath = "D:\work\test\ReportGenerator.4.8.3\tools\net47\ReportGenerator.exe"
$reportsParam = "D:\work\test\input\*.xml"
$targetPath = "D:\work\test\output"
$typePart = ' "-reporttypes:Cobertura"'
# the problem will occur.
. $reportGeneratorPath "-reports:$($reportsParam)" "-targetdir:$($targetPath)"$typePart
# Workaround: using 'Invoke-Expression'
Invoke-Expression @"
. $reportGeneratorPath "-reports:$($reportsParam)" "-targetdir:$($targetPath)"$typePart
"@
Thanks. Now I was able to reproduce your issue.
The problem is your parameter $typePart = ' "-reporttypes:Cobertura"'. It contains a leading space.
If you remove the space and use the following command instead, it also works (I added a leading space before $typePart):
. $reportGeneratorPath "-reports:$($reportsParam)" "-targetdir:$($targetPath)" $typePart
I would recommend this solution, it's not "correct" to add spaces to command line parameters itself. Instead you should add the space between the parameters.
Nevertheless I made a change to ReportGenerator 4.8.4 which removes leading and trailing spaces from command line parameters. This also fixes your problem.
I've just made sure the problem was fixed in 4.8.4.
Thanks for your quick action !