How can I change the column ordering of the output my code produces:
$apps = Import-CSV apps.csv
$computers = Import-CSV compobj.csv
foreach ($computer in $c
Format-Table
it's a good solution when you need to display your object fields in a specific order, but it will change the obect and you won't be able to pipe your object, for example when exporting to csv (Export-Csv
).
In the case you just want to change "the order of the fields in the object" use Select-Object
. This will preserve object type and fields, and still you will be able to pipe the object to other cmdlets.