title: PowerShell - Convert CSV to XLSX
body: <p>I found this script on here, please help me understand this better.</p>
  
  <ol>
  <li>What is the whole "gps" part of the script for?</li>
  <li>What part of this script is overwriting my original CSV and copying in the PC's taskmanager list?  Processes.</li>
  <li>What does this do, why 51?  ($xlOut,51)</li>
  </ol>
  
  <p>I went searching for "New-Object -com" and really couldn't locate what I thought I would find...  Doesn't explain what the -com does or provide a list of paramaters along with -com.  All I found was -comObject.</p>
  
  <pre><code>(gps excel -ErrorAction SilentlyContinue).count
  $csvpath="C:\path\to\file.csv"
  gps | Export-Csv $csvpath -NoTypeInformation
  $xl=New-Object -com "Excel.Application" 
  $wb=$xl.workbooks.open($csvpath)
  $xlout=$csvpath.Replace('.csv','.xlsx') 
  $wb.SaveAs($xlOut,51) 
  $xl.Quit()
  (gps excel -ErrorAction SilentlyContinue).count
  </code></pre>