title: Using Powershell to Export-Csv
body: <p>below is the code I am using to find duplicates in a <code>CSV</code> and total them up.
  I cant figure out how to <code>Export-CSV</code> correctly</p>
  <p>the code below shows what I need in the terminal window</p>
  <p>any help would be much appreciated</p>
  <pre><code> Import-Csv (Get-ChildItem &quot;E:\Bill3\output.csv&quot;) |         
   Group-Object -Property Code |
      Select-Object -Property @{Name='Code';Expression={$_.Name}}, 
          @{Name='Quantity';Expression={
              ($_.Group| Measure-Object -Sum -Property Quantity ).Sum
            
             
          }       
          }
  </code></pre>
  <p>this is how the terminal looks, this is what i would like my exported csv to look like</p>
  <p><a href="https://i.stack.imgur.com/Ah0wt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ah0wt.png" alt="enter image description here" /></a></p>