title: dotcover print coverage results to cmd line
body: <p>Is there a way to get dotcover to print a summary of the coverage results to the command line?</p>
  <p>I am trying to get my gitlab pipeline to output coverage results to the console so they can be picked up by a regex I specified in the pipeline settings. When I run the dotcover command I can only get it to generate a report and not print out anything to the console. I haven't been able to find anything <a href="https://www.jetbrains.com/help/dotcover/dotCover__Console_Runner_Commands.html" rel="nofollow noreferrer">in the docs</a> about printing results to the console.</p>
  <pre><code>dotcover cover 
      --targetExecutable=&quot;nunit3-console.exe&quot; 
      --targetArguments=&quot;...&quot; 
      --output=report.html 
      --reportType=HTML
  </code></pre>
  <p>The above generates the report correctly, but the only coverage output does not include any details about the coverage. I was hoping for something like <code>Coverage Summary: 89%</code> that I could pull out.</p>
  <pre><code>[JetBrains dotCover] Coverage session finished [7/27/2020 10:24:09 AM]
  [JetBrains dotCover] Coverage results post-processing started [7/27/2020 10:24:09 AM]
  [JetBrains dotCover] Report generation started [7/27/2020 10:24:09 AM]
  [JetBrains dotCover] Report generation finished [7/27/2020 10:24:10 AM]
  [JetBrains dotCover] Coverage results post-processing finished [7/27/2020 10:24:10 AM]
  </code></pre>
  <p>I realize I can use <code>--output=report.json --reportType=JSON</code> instead of HTML and then read the file to get the summary from the first <code>CoveragePercent</code> attribute, but I then I am no longer able to save the HTML report as an artifact.</p>
  <p><strong>Edit - here's how I solved this, based on KaiserBones answer</strong></p>
  <pre><code># first run the tests with coverage, generating a snapshot
  dotcover cover 
      --targetExecutable=&quot;nunit3-console.exe&quot; 
      --targetArguments=&quot;...&quot; 
      --output=&quot;coverage-results.snapshot&quot;
  
  # then, generate the JSON report 
  dotcover report --Source=&quot;results.snapshot&quot; --Output=&quot;coverage-results.json&quot; --ReportType=&quot;JSON&quot;
  
  # then, generate the HTML report (a nice way of examining results manually)
  dotcover report --Source=&quot;results.snapshot&quot; --Output=&quot;coverage-results.html&quot; --ReportType=&quot;HTML&quot;
  
  # Read the JSON file (my runners are on windows, so I'm using powershell)
  $coverageJson = (Get-Content &quot;coverage-results.json&quot; -Raw) | ConvertFrom-Json
  
  # Print the top level coverage result
  Write-Host &quot;Statements: $($coverageJson.CoveragePercent)%&quot;
  </code></pre>