I have three arrays such as Sender, Recipient and Subject; I need to arrange them in tabular form as below.
Sender Recipient Subject
[email protected] [email protected] xxx
Here is my code
dir|ForEach-Object {
$Name=$_.Name
foreach ($N in $Name) { Import-Csv $N|`
Foreach {
$Sender+=$_.SenderAddress
$Recipient+=$_.RecipientAddress
$Subject+=$_.Subject
}
}
}
Can anyone look into this?
Regards, Kiran
If you have multiple perfectly aligned arrays, you can easily zip them together with a
for
loop:Now you can use
Format-Table
: