Import-CSV Error…

Posted by in PowerShell

I had to create a crap load of contacts earlier for a migration using an import from an Excel file. I saved the Excel spreadsheet as a CSV file and went to run my script against it.

I got this error:

Import-Csv : Cannot process argument because the value of argument “name” is invalid. Change the value of the “name” argument and run the operation again.

Confused me for a bit until I realised that I had an empty column in the CSV file. It was trying to read in the column but it had no header name. I removed the column and the import worked perfectly.

A bit more of a descriptive error would be nice…?