"$($category.Parameter), whose status is $($Category.status)." } else { Write-Host "System is fully compliantin all parameter" -ForegroundColor Green } } } Find-Compliance -StatusID 'Non-Compliant'
上面的代码试过了,但是它提供了多个输出
compliant_imageshell: echo "WARNING - Non compliantwhen: ansible_net_image is not search(compliant_image)shell: echo "INFO - Compliantresult was False", }根据我对任务的理解,Print information if ok应该有一个值:INFO - Co