I'm currently trying to write an entire write to a line of a file, not new lines in powershell. I add items to the array using $array += $newitem (which works), yet when it adds the full array to the file (I've tried both streamwriter and out-file with append), it adds each item as a new line.
Pseudocode:
First round 1 then 2 then 3 are added to $array. Second round, which starts $array back at an empty state, 4 then 5 then 6 are added to $array. Then I output the data. The result in a file:
1,
2,
3
4,
5,
6
The output I want:
1,2,3
4,5,6