Export Compliance Reports

This post was originally published on this site

We are looking to get a report of missing patches and such from our hosts. I found this document from bbambalova, and wanted to see if anyone could assist me with it. From what I can tell, right now this script will run against ALL hosts found via the $vmHosts = Get-VMHost variable. We want to be able to run this against a specific set of hosts or even select clusters only; not the entire environment. I have tested with the following:

 

$vmHosts = Get-Content “C:esxihosts.txt”

 

Within that text file, I have a few hostnames that I’d like to run the report against. When I run the script (ExportCompliance.ps1 $vmHOsts “C:Reports”), I get the following error:

 

Cannot process argument transformation on parameter ‘inventoryItems’. Cannot convert the “esx1.host.com” value of type “system.String” to type “VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]”.

 

Is there any way I can set this up to run as I’d like? Or is there a better way to go about accomplishing my goal? Thank you.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.