I have this code that I am running from powershell. When I run it without the export-csv i get all the folder names on the screen.
dir | select -expand fulln
This worked for me:
$data = @() $row = New-Object PSObject $row | Add-Member -MemberType NoteProperty -Name "name1" -Value "Test" $row | Add-Member -MemberType NoteProperty -Name "name2" -Value 2 $data += $row $data | Export-Csv "Text.csv" -NoTypeInformation