0

I know you can use the export-csv feature to quickly export data to a csv file, but I keep getting an error of

Export-csv: can not bind parameter 'Delimiter'.
Can nnot convert value "C:\Test' to type System.Char
Error: String must be exactly one character long

This is my powershell syntax - and the data I want to export can have \ or a - in it

$info = (@'Foxtrot')
foreach ($in in $info)
{
  $Dir = "C:\$in"
  export-csv C:\$in.csv $Dir
}
FunFly WhiteGuy
  • 163
  • 2
  • 2
  • 11

1 Answers1

1

Try using the parameter names as the -Delimiter is the second parameter e.g.

Export-Csv -Path "C:\$in.csv" -InputObject $Dir
Richard
  • 6,812
  • 5
  • 45
  • 60