thanks for your help. i'm getting the error on the the vapp.Undeploy line.
Not really sure what to check to see why it's throwing that error... is it possible my Vapp object doesn't have reference to the VM inside it, causing this error? just spitballing here...