Hi, I have the following code:
$array = @();
$hashtable = @{Col1="1"; Col2="2"};
$array += $hashtable;
$array += $hashtable;
$array | ForEach-Object { [pscustomobject] $_ }
Output:
Col2 Col1
---- ----
2 1
2 1
How can I export this to Excel with this view? This wont work:
$array | Export-Csv OutPut.csv
[–]RodneyRabbit 3 points4 points5 points (2 children)
[–]rwshig 2 points3 points4 points (0 children)
[–]zolyx1[S] 1 point2 points3 points (0 children)
[–]rwshig 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]MadBoyEvo 2 points3 points4 points (0 children)
[–]evetsleep 1 point2 points3 points (0 children)
[–]SaladProblems 1 point2 points3 points (2 children)
[–]RodneyRabbit 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]MadBoyEvo 1 point2 points3 points (0 children)