0

I know typically when you export to excel you can use a PSCustomObject. However this creates defined columns headers, for example:

[PSCustomObject]@{
“Name” = $name
“Number” = $number
“Color” = $color} | export-CVs

CSV output
Name     Number     Color
Bob      1          Blue
Carl     2          Red

But is there anyway to export without static headers?

For example

$array1 = (Bob,1,red)
$array2 = (Carl,2,blue)

Bob     Carl -> this is row 1
1       2
Red     Blue
  • There is a `-NoHeader` you should need to look at the cmdlet's help ;) – Santiago Squarzon Aug 29 '23 at 17:51
  • using the function from the linked answer you can do `$array1, $array2 | Join-Array A,B,C | Export-Csv -NoHeader` – Santiago Squarzon Aug 29 '23 at 21:42
  • When I export an array is just gives me the length not the actual array value. Also let’s say the amount of arrays might be dynamic so would it be like temp array join max array and keep looping like that? – Bob Johnson Aug 30 '23 at 21:15

0 Answers0