2016-03-17 109 views
0

我正在使用uipath啓動PowerShell腳本。我需要從uipath中傳遞一個參數。首先這是可能的,其次有沒有人有這樣的例子?不知道PowerShell腳本中的語法是什麼帶UiPath的Powershell

回答

0

是否有可能將參數從UiPath傳遞到終端。 。

  • 你的PowerShell腳本需要被保存在一個txt文件 (PSSampleParameters.txt)

代碼示例(PSSampleParameters.txt):

Param(
    [string]$computerName 
) 

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 
[System.Windows.Forms.MessageBox]::Show($computerName) 
  • 添加「讀取文本文件「活動並在文件名上添加您的PowerShell腳本。

Read Text File activity

  • 添加 「調用電源外殼」 的活動,並確保您設置 「ContinueOnError」 到並勾選 「IsScript」

Invoke Power Shell Activity

  • 選擇「調用電源外殼」活動選擇右側面板並點擊Parameters中的「...」按鈕。在打開的屏幕中,您可以添加參數。

Add Parameter

+0

嗯..我有一個由蹬掉一個PowerShell腳本連接到共享郵箱的過程。我不想鐵桿用戶名/密碼進入的PowerShell中通過它傳遞uipath活動 –

+0

可以檢查以下2個鏈接:http://www.uipath.com/examples/it-automation-powershell-read-text-files&http://www.uipath.com/examples/it-automation- powershell-get-public-ftp-file? – Andrei

+0

這裏有更多的細節:[更多示例](http://www.uipath.com/resources#stq=powershell&filters=solutions%20videoTutorials%20userGuides%20examples%20quickAnswers) – Andrei