带有 UiPath 的 Powershell [英] Powershell with UiPath

查看:99
本文介绍了带有 UiPath 的 Powershell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 UiPath 启动 PowerShell 脚本.我需要从 UiPath 传入一个参数.首先这是可能的,其次有人有这样的例子吗?不确定 PowerShell 脚本中的语法是什么

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

推荐答案

是否可以将参数从 UiPath 传递到终端.

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

  • 您的 PowerShell 脚本需要保存在 txt 中文件.(PSSampleParameters.txt)

代码示例(PSSampleParameters.txt):

Code sample(PSSampleParameters.txt):

Param(
  [string]$computerName
)

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 
[System.Windows.Forms.MessageBox]::Show($computerName) 

  • 添加读取文本文件"活动并在文件名上添加您的 PowerShell 脚本.
    • 添加调用 Power Shell"活动并确保将ContinueOnError"设置为 True 并选中IsScript"
    • Add "Invoke Power Shell" activity and be sure that you set "ContinueOnError" to True and check "IsScript"

    • 选择调用电源外壳"活动后,转到右侧面板,然后单击参数"中的..."按钮.在打开的屏幕中,您可以添加参数.

    这篇关于带有 UiPath 的 Powershell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆