Hello everybody,
I just started using the VimClient with C#/.NET
I have the following code:
VimClient client = new VimClient(); client.Connect(serviceUrl); client.Login(userName, password); NameValueCollection filter = new NameValueCollection();
int countCheckedVMs = clbVMsToolsNeedUpgrade.CheckedItems.Count - 1; for (int i = 0; i <= countCheckedVMs; i++ ) { string displayName = clbVMsToolsNeedUpgrade.CheckedItems[i].ToString();
filter.Add("Config.Name", displayName); MessageBox.Show(filter[0].ToString()); IList<EntityViewBase> vmList = client.FindEntityViews(typeof(VirtualMachine), null, filter, null); foreach (VirtualMachine vm in vmList) { vm.UpgradeTools("/S /v\"/qn REBOOT=ReallySuppress\""); rtbLog.AppendText("VMware Tools-Upgrade for VM " + displayName + " started\n"); }
filter.Remove("Config.Name"); }
client.Disconnect();
This is working good until it comes to a VM which has brackets in its displayname.
So a VM called "My Server" is working but not "My Server (rellay)"
I have no idea why, cant the VimClient handle the brackets?