title: While using Export-Csv in powershell, how to exclude #TYPE Selected.System.Management.ManagementObject from the output
body: <p>I am using the following PowerShell script to obtain Name, DisplayName, State, StartMode and PathName of all windows services of a local machine and then export the output to a csv file using the <strong>Export-csv</strong> cmdlet, </p>
  
  <pre><code>Get-WmiObject win32_service | Select Name, DisplayName, State, StartMode, PathName | Export-Csv C:/ListOfServices.csv
  </code></pre>
  
  <p>the script works fine but the problem is, the first row of the output csv file contains </p>
  
  <pre><code>#TYPE Selected.System.Management.ManagementObject
  </code></pre>
  
  <p>Is there any way to exclude this line from the output? I am preparing a script to get all these details from all server machines in the network, so excluding this line becomes important.</p>