CSV
We start with the CSV file extension, as this is the most basic one. We will make use of the previous example, where we stored the currently running processes to file:
#Defining file for export $exportedFile ='C:\temp\exportedProcesses.csv' #Exporting as CSV - basic Get-Process | Export-Csv $exportedFile #Opening the file psedit $exportedFile
After running this simple example, you will have the opened CSV file in front of you, which consists of all the processes and each value, separated by commas. And that is what CSV actually stands for: comma-separated values. The benefit of working with CSV files is that you will get table-like custom objects returned, which can easily be filtered. This file type makes sense, especially for simple data objects. Importing is very straightforward:
#Importing CSV file $data = Import-Csv $exportedFile #Showing content $data | Out-GridView #Showing its type $data | Get-Member # TypeName: CSV:System.Diagnostics.Process $data[0].GetType()# PSCustomObject...