To get the numbers you will have to use the Measure-Object cmdlet.
Like this
Get-Compliance -Entity $inventoryItem -Detailed |
Select @{N="EntityName";E={$_.Entity.Name}},
@{N="Baseline";E={$_.Baseline.Name}},
@{N="Compliant Patches";E={$_.CompliantPatches | Measure-Object | Select -ExpandProperty Count}},
@{N="Not Compliant Patches";E={$_.NotCompliantPatches | Measure-Object | Select -ExpandProperty Count}},
@{N="Unknown Patches";E={$_.UnknownPatches | Measure-Object | Select -ExpandProperty Count}},
@{N="Not Applicable Patches";E={$_.NotApplicablePatches | Measure-Object | Select -ExpandProperty Count}},
Status |
Export-Csv "c:\compliance.csv" -UseCulture
The problem with the text file is most probably caused by the .ps1xml file that controls the formatting of these properties (but that is another story).
So add the Format-Table again.
Get-Compliance -Entity $inventoryItem -Detailed |
Format-Table -AutoSize |
Out-File -Width 255 -FilePath "c:\compliance.txt"