I feel like I'm getting closer!
For the first one, I've added this code:
Get-Compliance -Entity $inventoryItem -Detailed | Select @{N="EntityName";E={$_.Entity.Name}}, @{N="Baseline";E={$_.Baseline.Name}}, @{N="Compliant Patches";E={$_.CompliantPatches.Name}}, @{N="Not Compliant Patches";E={$_.NotCompliantPatches.Name}}, @{N="Unknown Patches";E={$_.UnknownPatches.Name}}, @{N="Not Applicable Patches";E={$_.NotApplicablePatches.Name}}, Status | Export-Csv "$path\PatchComplianceReport_$CurrentDate.csv" -UseCulture
When I do that, it will output to a CSV file with the correct headings. However there are no numerical values
And for the plain text file, when I simplify it as you mention it truncates the text. Is there a way to have it display in formatted columns?
Thank you!