Here is a quick way of selecting the VMware Tools Advanced option: “Check and upgrade Tools during power cycling” for all VMs in a cluster. Here is a screen shot of the option in question:
And here is the script:
$vms = get-cluster "Cluster Name" | get-vm foreach($vm in $vms) { $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.changeVersion = $vm.ExtensionData.Config.ChangeVersion $spec.tools = New-Object VMware.Vim.ToolsConfigInfo $spec.tools.toolsUpgradePolicy = "upgradeAtPowerCycle" $_this = Get-View -Id $vm.Id $_this.ReconfigVM_Task($spec) }