VMware {code} Community
harshapala
Contributor
Contributor

VMWARE Tools update | PowerCLI error (Method invocation failed)

Hi,

I'm getting this error while trying to update VMWARE tools via powerCLI

Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl] does not contain a method named 'op_Addition'.
At C:\Users\Administrator\Documents\coredump.ps1:24 char:5
+ $report += $strNewVMName
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

#Script

$vCenter="vcenter.eng"


# connect vcenter
Connect-VIServer -Server $vCenter -protocol https -User "administrator" -Password "Password"

# extract vms from vcenter
$vm_list += Get-VM -Name WIN*


ForEach($vm in $vm_list)
{
# update vmware tools

$strNewVMName = $vm

Get-Datacenter "QA" | Get-VM $strNewVMName | Update-Tools –NoReboot

write-host "$strNewVMName ------ "

$report += $strNewVMName

}

0 Kudos
1 Reply
mhb4ever
Enthusiast
Enthusiast