Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

TagCategory

$
0
0

Hi All,

 

I need to get TagCategory. I started using powerCli.

 

The following is the script.

 

 

try{

  var session = powerShellHost.openSession();

 

  var sessionID = session.getSessionId()

 

 

System.getModule("com.vmware.library.powershell.generated").addPSSnapIn(powerShellHost,sessionID,"VMware.VimAutomation.Core",false,false,false,"","","") ;


 

var actionResult = System.getModule("com.vmware.library.powershell.generated").connectVIServer(powerShellHost,sessionID,"vcenterHost",443,null,null,"userid","Password",null,null,null,null,null,null,null,null,null,null,null) ;

 

var oSession = powerShellHost.getSession(sessionID);

var cmd = oSession.addCommandFromString('Get-TagCategory');

var res = System.getModule("com.vmware.library.powershell").invokeCommand(powerShellHost,sessionID) ;

 

 

  System.log("Result of TagCategory:"+res.getXml());

}

catch(err){

System.log(err);

}

finally{

  powerShellHost.closeSession(session.getSessionId());

}

 

addPSSnapIn takes long time. Is this normal?


connectVIServer method is called but actionResult is not used in the script. I have seen similar behavior in powercli example workflows. Is it required to connect.


invokeCommand sometimes throws out of memory. What is wrong in the script.


Is it possible to convert invokeComand return object into VCO object with ConvertTO method?


Thanks in advance.



Viewing all articles
Browse latest Browse all 6251

Trending Articles



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