VMware Cloud Community
roniyako
Contributor
Contributor

VRO - Extract Output from Powershell 'Invoke a Powershell Script'

Hi,

I have a Workflow that looks like the below.

pastedImage_0.png

I Generate a script and invoke it on one of my powershell hosts. It's supposed to create a ELB in AWS, and the below output of the script is generated.

pastedImage_1.png

What is the best what to extract that output and save it as a variable in the workflow to use in other workflows?

0 Kudos
3 Replies
daphnissov
Immortal
Immortal

This question was also asked earlier here.

0 Kudos
roniyako
Contributor
Contributor

Slightly different question, i know how that works because i'm using the output of the script i generate and passing it to the second action. The 'Invoke a powershell' itself only has one output which is a PowershellRemoteObject type, my question is getting a text output.

0 Kudos
ehlomarcus
Contributor
Contributor

Hi

I hope that this is what you are after:

Lets say you have a Powershell script which has a function that has this as return:

return $thumbprint

Then when you have your "Invoke a Powershell script" executed and the output is in outputPsScript, then you can get your return value using a scriptable task using code:

thumbprint = outputPsScript.getRootObject().getProperty("thumbprint");

//Marcus

0 Kudos