I have another question on how to run the script. Right now I'm doing the following:
Set my hosts in C:\esxihosts.txt:
$vmHosts = Get-Content "C:\esxihosts.txt"
Then I'll run the script with:
ExportCompliance.ps1 (Get-VMHost -Name $vmHosts) "C:\Reports\"
Everything runs perfect like this. I was hoping to set these up as scheduled reports, and was wondering how I could set the variables within the script itself. For instance, I could have one script setup with the $vmHosts variable to point to esxihosts1.txt, and another script to point to esxihosts2.txt.