Hello guys,
is there a way to get an object of my Powershell Host? I want to open Sessions and send commands directly in my script without a workflow.
Something like this:
//modify properties psHost.name = "myPSHost01"; psHost.transportProtocol = "HTTPS"; //invoke methods psHost.openSession(); psHost.invokeScript(script); psHost.closeSession(id);
With some research here i found this but i cannot use the output of this statement.
var psHosts = Server.findAllForType("PowerShell:PowerShellHost",null); //com.vmware.o11n.plugin.powershell.scripting.PowerShellHost for(psHost in psHosts) { System.log(psHosts[psHost]); }
Log:
[2016-11-14 14:17:49.306] [I] DynamicWrapper (Instance) : [PowerShellHost]-[class com.vmware.o11n.plugin.powershell.scripting.PowerShellHost] -- VALUE : com.vmware.o11n.plugin.powershell.scripting.PowerShellHost@3a5c781f
Does anyone of you know how the answer?
Thanks