如何更改代码生成的输出的显示方式:
$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 @{Computer=$computer.hostname;App=$app.appname;Installed=$installed}
}
}
我希望更改代码的呈现方式。这是它的样子:
Name Value
---- -----
Installed True
App App1
Computer 171.159.192.10
Installed True
App App2
Computer 171.159.192.10
我希望它看起来像这样:
Computer App1 App2
----------- ------ -----
171.159.192.10 True True