I want to execute a powershell command in a VM and use the output of this command. Is it possible?
I already know how to run powershell command in VM with Run Program guest workflow.
You can either use Guest Operations API (connects through vmware tools, no network connection between vRO and the target VM needed) or the Powershell Plugin (through VM network).
For the first, check out the Guest Script Manager Package: Leveraging the Guest Script Manager package
If you want to use the Powershell Plugin, the invokeScript() method returns the output of the script, so you can process it later in your workflow. Check out these examples:
I use the Guest Script Manager package, and now I receive the output to the orchestrator.
But how can I use it?
I run a powershell command which retrieve from my Domain Controller all the distribution groups with their mail Addresses.
I would like to prompt a list of mail addresses when the user run the workflow.
How can I do it?
JSON works really well to pass results from powershell to vRO. I recommed formatting the text return from powershell as a JSON object. Using JSON objects in vRO is easy - please reference this blog post. Creating json objects in Orchestrator