脚本以匹配Powershell软件

时间:2018-06-29 19:57:04

标签: powershell compareobject

Write-Host "Missing Software listed below..." -ForegroundColor Red 

if ($Zbook){
    Compare-Object -ReferenceObject $SLZ -DifferenceObject $SLAcutal -Property DisplayName -PassThru | 
    Where-Object{$_.SideIndicator -eq '<='} | 
    Select-Object DisplayName | Format-Table -HideTableHeaders 
} 
Else{
    Compare-Object -ReferenceObject $SLS -DifferenceObject $SLAcutal -Property DisplayName -PassThru | 
    Where-Object{$_.SideIndicator -eq '<='} | 
    Select-Object DisplayName | Format-Table -HideTableHeaders
}

这是我的第一个脚本,从概念上讲,如果比较引用,我只希望显示写入主机“缺少软件...”。对象与差异对象不匹配。和“缺少软件”(如果匹配

任何提示将不胜感激。

预先感谢

0 个答案:

没有答案