如何更改代码生成的输出的列顺序:
$apps = Import-CSV apps.csv
$computers = Import-CSV compobj.csv
foreach ($computer in $computers) {
$computerLob = $computer.lob
$lobApps = $apps | ? {$_.lob -eq $computerLob }
foreach ($app in $lobApps) {
$computerHostname = $computer.hostname
$appLocation = $app.location
$installed=Test-Path "\\$computerHostname\$appLocation"
New-Object PSObject -Property @{
Computer=$computer.hostname
App=$app.appname
Installed=$installed
}
}
目前它按以下顺序生成列:Installed,App,Computer
.
我想按以下顺序排列:Computer,App,Installed
.