That is in fact what my 2nd example in my previous answer is doing.
You only need to output the object to the Select-Object cmdlet, where you specify which properties to show, and then the result goes to the CSV file with the Export-Csv cmdlet.
Coming back to your TXT file lines, you can simplify that a bit.
Get-Compliance -Entity $inventoryItem -Detailed |
Out-File "$path\PatchComplianceReport_$CurrentDate.txt" -Width 5000
The Format-Table cmdlet is intended for screen output.
The Sort is not needed on Entity, since the Get-Compliance can only accept one entity on each call.
You could sort on the Basline name.