Thanks again LucD. I think I will leave that script as-is for a detailed view.
You did get me thinking though. If I run:
$Get-Compliance -Entity servername -Detailed
I get a decent output showing a summary view. This may actually be ideal for what I'm doing. How can I output this into a text file?
EDIT: I was able to get this to output correctly to a text file with the following:
$compliances = Get-Compliance -Entity $inventoryItem -Detailed | Sort-Object -Property Entity | Format-Table -AutoSize | Out-String -Width 5000 | Out-File "$path\PatchComplianceReport_$CurrentDate.txt"
Another followup! Am I correct in this script will only output results if there is an existing scan?