When you want to run this against all hosts in a cluster, you could do
Get-Cluster -Name
$clusterName | Get-VMHost |ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $_ -V2
$esxcli.system.wbem.set.Invoke(@{enable=$false})
$esxcli.system.wbem.get.Invoke()
}
And when you want to select the ESXi nodes via a CSV, you could do.
This snippet assumes the CSV has a column with the name VMHost.
Import-Csv -Path .\vmhost.csv
-UseCulture
|ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $_.VMHost -V2
$esxcli.system.wbem.set.Invoke(@{enable=$false})
$esxcli.system.wbem.get.Invoke()
}