VMware Cloud Community
dennisjohnsonfh
Contributor
Contributor

Email Results of Invoked Powershell

HI, I have spent a few days looking for away to export the output of the "invoke a powershell" module but can't seem to find anything recent. Most post point me to writning Javascript to get the results into an email. My thougth is you can have "invoke a powershell" and the map the output of that to the content of the "Send notfication" module. Can I map this in visual binding or do I need to write Javascript? 

Thanks. 

Reply
0 Kudos
3 Replies
eoinbyrne
Expert
Expert

The output class has this structure

pastedImage_0.png

You can get the console output (if there was any...) by calling the getHostOutput() method which gives you a string value. You can pass this to the Send Notification workflow in the content input

HTH

Reply
0 Kudos
dennisjohnsonfh
Contributor
Contributor

Thanks for the info. However, I am only a few days new to this product so i'm a little lost with the plugin you mentioned. Do I need to import this to the output of the Invoke Powershell? Do I need to call that method via javascript and then access it via export?
Reply
0 Kudos
eoinbyrne
Expert
Expert

The easiest way is to create a new workflow in the client which calls the PowerShell workflow, then maps the output to the Send Notification workflow

pastedImage_0.png

You will need to write a little Javascript for the middle piece but it should not be too difficult

Reply
0 Kudos