Powershell with UiPath

2019-05-31 03:04发布

I am kicking off a PowerShell script with UiPath. I need to pass an argument in, from UiPath. Firstly is this possible and secondly does anyone have an example of this? Not sure what the syntax is for this in the PowerShell script

1条回答
萌系小妹纸
2楼-- · 2019-05-31 03:32

Is it possible to pass arguments from UiPath to the terminal.

  • Your PowerShell script needs to be saved in a txt file.(PSSampleParameters.txt)

Code sample(PSSampleParameters.txt):

Param(
  [string]$computerName
)

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 
[System.Windows.Forms.MessageBox]::Show($computerName) 
  • Add a "Read Text file" activity and on filename add your PowerShell script.

Read Text File activity

  • Add "Invoke Power Shell" activity and be sure that you set "ContinueOnError" to True and check "IsScript"

Invoke Power Shell Activity

  • With "Invoke power shell" activity selected go to on right panel and click on "..." button from Parameters. In the screen that will open you can add your parameters.

Add Parameter

查看更多
登录 后发表回答