PowerShell provides two cmdlets that help greatly when you are dealing with files in the comma-separated value (CSV) format:
Import-Csv—This cmdlet reads in a CSV file and creates objects from its contents.
Export-Csv—This cmdlet takes an object (or objects) as input and creates a CSV file, as shown here:
PS>dir | Export-Csv c:\temp\file.csv
This simple example shows how to output the contents of the current directory to a CSV-formatted file. Looking at the contents of this file displays information ...