How to: stdout from command line to UiPath variable



Hello, if you need to grab the ‘stdout’ output from a command line process (“C:> dir C:\work*.*”, for example), or from a PowerShell script, this may help.

The attached workflow uses AutoHotKey.Interop and Invoke Code. Included are Ui_Var3.ahk, StdOutToVar.ahk (the function lib), uipath_test.csv, and AA11.xaml.

(I will test this with the bash commands available on Win10 when I have a chance to use a system that has Win10 and bash installed. I believe making the output of Linux shell commands available to UiPath would be useful. I will also experiment with alternate implementations of StdOutToVar, which can be found here. My hat’s off to these coders.)

Feedback appreciated.

Input dialog for the command:

Command In

Output to UiPath message box from “Invoke Code”:

A PowerShell command (‘awk-ish’) in, to pull a column from a csv file:

PS Command in

And the output of the extracted column to a Message Box:

PS 'awk' clone out

All feed back appreciated, once again!
burque505 (4.3 KB)