Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Case insensitive search for VM by name

$
0
0

I found sample code in the communities, but it appears that the searches are case sensitive.  We need help modifying the script to make it case insensitive.

 

 

var vms = VcPlugin.getAllVirtualMachines(null, "xpath:name='"+vmName+"'"); 
var vmObject = null;  
if (vms != null && vms.length >0){    System.log("VMs Found: " + vms.length);    if (vms.length == 1){          System.log("Match found for vm named: "+vmName);          vmObject = vms[0];      }else{          System.log("More than one VM found with that name! "+vmName);          for each (vm in vms){              System.log("VM ID: "+vm.id);          }      }  
}else{  System.log("No VMs Found");
}

.


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>