VMware {code}

 View Only
Expand all | Collapse all

VMWARE Tools update | PowerCLI error (Method invocation failed)

  • 1.  VMWARE Tools update | PowerCLI error (Method invocation failed)

    Posted Jan 01, 2024 06:56 AM

    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

    }



  • 2.  Re: VMWARE Tools update | PowerCLI error (Method invocation failed)

    Posted Jan 01, 2024 09:06 AM