Basic usage of Import-Csv

suggest change

Given the following CSV-file

String,DateTime,Integer
First,2016-12-01T12:00:00,30
Second,2015-12-01T12:00:00,20
Third,2015-12-01T12:00:00,20

Import the CSV rows as PowerShell objects with Import-Csv. Every field is a string; the header names do not set the .NET type.

$listOfRows = Import-Csv .\example.csv
$listOfRows
String DateTime            Integer
------ --------            -------
First  2016-12-01T12:00:00 30
Second 2015-12-01T12:00:00 20
Third  2015-12-01T12:00:00 20
Write-Host $listOfRows[0].String
First

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents