how to get vcVms by regex expression

get vcVms by regex

var vmPattern="[a-z]{5}[0-9] [3]"
var allVms = VcPlugin.getAllVirtualMachines();
 var foundVms = new Array ();
// Check if the VM match the regexp
for (var i in allVms) {
   if (allVms[i].name.match(vmPattern)) {
      foundVms.push(allVms[i]);
      System.log("found Vm: "+allVms[i].name);
   }
}            

return foundVms;

Comments

Popular posts from this blog

CSP-102547 Patch Upgrade Experience VMware Identity Manager 3.3.7 & Aria Suite Lifecycle 8.18.0 (Patch 5 → 7)

Bulk Import DFW Rules to NSX-T using Aria Automation

VCF 9 Automation vs Aria Automation 8.x (Part 1)