I am trying to read values from a .csv file using PowerShell to create Document Sets in SharePoint, but my code stalls when I get to this line
$oData = Import-CSV H:\sample.csv -Header Name, Invoice Number,Order Number
I get this error...
Import-Csv : Cannot convert 'System.Object[]' to the type 'System.Char' required by parameter 'Delimiter'. Specified method is not supported.
At C:\workspace\powershellscripts\Create-DocumentSets.ps1:8 char:62
+ $oData = Import-CSV H:\sample.csv -Header Name, Invoce Number,Order Number
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Import-Csv], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.ImportCsvCommand
I am using a typical comma delimited csv file. Does anyone have any idea why I am getting this error? I really appreciate the help and ideas.