VMware {code} Community
ma11achy
Contributor
Contributor

How to check if VirtualApp is started

Hi there,

I'm pretty new to the VIM API and am trying to evaluate if a vApp is started or not. I've found the VirtualAppVAppState enum but can't seem to figure out how to test it.

I've included a C# code snippet below - would appreciate anyone letting me know where I'm going astray...

Thanks!

NameValueCollection filter = new NameValueCollection();

filter.Add("Name", "^vapp");

IList<EntityViewBase> vappList = c.FindEntityViews(typeof(VirtualApp), null, filter, null);

foreach (VirtualApp vapp in vappList)

{

     if (vapp.???????? == VirtualAppVAppState.started) //<-- Can't figure out how to evaluate the LHS??

...

Tags (3)
Reply
0 Kudos
0 Replies