Definitely digging your shortcut! I pretty much abandoned the original script. Here's is how I have been running my query:
$vmesxi = (Get-VMHost -Name (Get-Content "C:\esxihosts.txt")) # Get today's date $CurrentDate = Get-Date $CurrentDate = $CurrentDate.ToString('MM-dd-yyyy_hhmmss') # Set Output Path $path = "C:\Reports\" foreach ($i in $vmesxi) { Get-Compliance -Entity $i -Detailed | Select @{N="Host Name";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 "$path\PatchComplianceReport_$CurrentDate.csv" -UseCulture -NoTypeInformation }
And there are two hostnames in the text file.