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

How do i get a Powershell:PowershellHost Object?

$
0
0

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


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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