VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Allow UUID for Invoke-VMScript

This would allow people with multiple VMs that share the same name but have different UUIDS to then use Invoke-VMScript on indiviual machines. You can just add a -UUID after the -VM name option maybe?

  • Guest
  • Dec 1 2022
  • Will not implement
  • Attach files
  • Admin
    Kamen Nikolov commented
    2 Dec, 2022 09:06am

    Invoke-VMScript does not take VM name as an input. It takes a VM object. There is a special mechanism that allows users to pass a name, which is then converted to a VM object, but this mechanism should not be used when you have VMs with duplicating names. In this case you should use:

    Get-VM -Id <vmid> | Invoke-VMScript

    This will retrieve the VM by its id and then invoke the script on this VM.