CSV File Handling

There are two angles to this, reading CSV files and writing CSV files.


Assuming you have an array of objects in a variable called $report then the following line will export that to a CSV file, which Microsoft Excel should read just fine:
$report | Export-Csv -Encoding UTF8 -NoTypeInformation -Path ".\output.csv"
This CmdLet is documented on Microsoft Technet at Export-Csv, note that append was added in PowerShell 3.0, before that you have to do it manually.


Simple reading is done with Import-Csv, see also Using the Import-Csv Cmdlet and powershell import csv foreach for further help.