Output two dimensional array to csv file in PowerShell

powershell, powershell-2.0

Solution

Try this

$a | % { $_ -join ','} |  out-file .\myfile.csv

Problem

Given `$a = (("a","b","c"),("d","e","f"))` I want `$a` exported to a csv file like this ``` a,b,c d,e,f ``` Something so simple seems tricky. What's the best way, my file will be less than 40 lines long.

Original source