I wish to create a table from my Powershell Output. The output is correct if I only use 4 columns
Naam RFC Status Last_Modification_Date
---- --- ------ ----------------------
Daan 838065 Approved to Implement 2017-12-19T10:21:56
Daan 838061 Approved to Implement 2017-12-19T10:48:29
Daan 837103 Approved to Implement 2017-12-19T07:08:33
Daan 835761 Approved to Implement 2017-12-15T08:34:44
Daan 835762 Approved to Implement 2017-12-18T08:38:51
Daan 835748 Approved to Implement 2017-12-15T12:25:46
Daan 834721 Approved to Implement 2017-12-08T11:48:13
Daan 834656 Approved to Implement 2017-12-08T11:48:30
Daan 831541 Approved to Implement 2017-12-07T10:16:21
But as soon as I add a column more, I get this kind of output, how do I get the output to be as I prefer?
Naam : Theunis Daan
RFC : 837103
Status : Approved to Implement
Last_Modification_Date : 2017-12-19T07:08:33
Start : 1513317360
Naam : Theunis Daan
RFC : 835761
Status : Approved to Implement
Last_Modification_Date : 2017-12-15T08:34:44
Start : 1513238880
Naam : Theunis Daan
RFC : 835762
Status : Approved to Implement
Last_Modification_Date : 2017-12-18T08:38:51
Start : 1513253340
The code that gives the correct output is uncommented, the full output I'd wish is in comment, but that gives me the wrong output style.
foreach ($change in $Changes.objects) {
if ($change.assignee_full_name -eq "Daan"){
$Output = "" | select "Naam", "RFC", "Status", "Last_Modification_Date"
$Output.Naam = $change.assignee_full_name
$Output.RFC = $change.change_ref
$Output.Status = $change.change_status
$Output.Last_Modification_Date = $change.last_mod_date
Write-Output $Output
<#$temp = "" | select "RFC", "Summary", "Status", "Last_Modification_Date", "Start", "Need_By", "Assignee"
$temp.RFC = $change.change_ref
$temp.Summary = $change.change_summary
$temp.Status = $change.change_status
$temp.Last_Modification_Date = $change.last_mod_date
$temp.Start = $change.planned_date_timestamp
$temp.Need_By = $change.change_active_date_timestampe
$temp.Assignee = $change.assignee_full_name
Write-Output $temp #>
}
}