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
}
这是我的第一个脚本,从概念上讲,如果比较引用,我只希望显示写入主机“缺少软件...”。对象与差异对象不匹配。和“缺少软件”(如果匹配
任何提示将不胜感激。
预先感谢