While using Export-Csv in powershell, how to exclude #TYPE Selected.System.Management.ManagementObject from the output
Add the -NoTypeInformation
switch in your Export-CSV
command, like this:
Get-WmiObject -Class win32_service |Select Name, DisplayName, State, StartMode, PathName |Export-Csv -NoTypeInformation -Path C:/ListOfServices.csv
you need to include -NoTypeInformation in export-csv command to avoid
TYPE Selected.System.Management.ManagementObject
ex: Export-Csv -Path "your path for the export file" -NoTypeInformation