-2

I am trying to run a powershell script with uipath. I have found two approaches to run it;

Read the script as a text and pass to Invoke Powershell activity Use Run powershell script activity from Script Activities package Now I need to pass arguments to the powershell script from uipath. Some have mentioned about formatting the string with parameters and invoking the script.

But, rather than that, think we can directly pass parameters from UiPath.

In Run Powershell script, it has Parameters as input

In Invoke Powershell, it has Parameters under Input section and PowershellVariables under Misc

I have been searching for a while. But still I am unable to figure out how to pass parameters using above activities.

I am trying to send outlook mails using powershell. Still in the process of learning how to work with it. Plz help…

EDIT

Found solution for one approach. Added it as an answer.

udani
  • 1,243
  • 2
  • 11
  • 33
  • Possible duplicate of [Return output from Powershell script to UIPath using Invoke power shell](https://stackoverflow.com/questions/53017215/return-output-from-powershell-script-to-uipath-using-invoke-power-shell) – Wolfgang Radl Nov 15 '18 at 17:28
  • Well, in above topic also I have raised my question, because he has only mentioned that we can use the parameters. I have followed rest of his steps. But still unable to figure this out. – udani Nov 16 '18 at 05:32

1 Answers1

-1

Found an answer from this link. Out of the two approaches, it provides a solution to pass the parameters using Invoke Power Shell activity.

  • Read the .ps1/.txt file containing the script, with Read Text File activity
  • Call the Invoke Power Shell activity by passing file content as CommandText and parameters in the Parameter collection.

But, it would be great, if I can get to know how to pass parameters using Run power shell script activity.

udani
  • 1,243
  • 2
  • 11
  • 33