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
Post a Comment