OK great - thanks. It seems to restart the agents, but it generates this error:
Restart-VMHostService : Restart-VMHostService An error occurred while communicating with
the remote host.
At line:1 char:106
+ get-vmhostservice -vmhost esx12.internal.com | where {$_.Key -eq "vpxa"} | Restart-VMHostService <<<< -conf
irm:$false
+ CategoryInfo : NotSpecified: (:) [Restart-VMHostService], HostCommunication
+ FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_SetVMHostService_ViError,VMware.VimAutomation.ViCor
e.Cmdlets.Commands.RestartVMHostService
Can this error be avoided?