Neither do I.
I spent several minutes to figured out that and I thought it would be a good idea if I share this here. ![]()
I don't know if this is the right place but: also there is another interesting fact: "boolean maintenancemode" doesn't work (I set it to $true). I put two hosts in maintenance mode but the script above patched all hosts in the cluster without skipping the hosts which are not in maintenance mode. The version of the vCenter Server is "vCenter Server 5.1 Update 2a", ESXi "ESXi 5.1 Patch 5" (all hosts), PowerCLI 5.8 Release 1 (I also tried with PowerCLI 5.1 Release 1).
I would like to express my gratitude here for the information you have shared.
This information saved me a couple of hours.