共用方式為


ServiceFabricPowerShell@1 - Service Fabric PowerShell v1 工作

使用此工作在 Azure Service Fabric 叢集連線的內容中執行 PowerShell 腳本。 在已初始化 Service Fabric 叢集連線的 PowerShell 工作階段中執行任何 PowerShell 命令或腳本。

語法

# Service Fabric PowerShell v1
# Run a PowerShell script in the context of an Azure Service Fabric cluster connection.
- task: ServiceFabricPowerShell@1
  inputs:
    clusterConnection: # string. Alias: serviceConnectionName. Required. Cluster Service Connection. 
    ScriptType: 'FilePath' # 'FilePath' | 'InlineScript'. Required. Script Type. Default: FilePath.
    #ScriptPath: # string. Optional. Use when ScriptType = FilePath. Script Path. 
    #Inline: # string. Optional. Use when ScriptType = InlineScript. Inline Script. 
    #ScriptArguments: # string. Script Arguments.

輸入

clusterConnection - 叢集服務連線
輸入別名:serviceConnectionNamestring。 必須的。

指定執行指定的 PowerShell 腳本時,將會有已建立的服務連線的 Azure Service Fabric 叢集。


ScriptType - 文稿類型
string。 必須的。 允許的值:FilePath(腳本檔案路徑)、InlineScript(內嵌腳本)。 預設值:FilePath

指定文稿是以檔案或內嵌的形式提供於工作中。


ScriptPath - 文稿路徑
string。 選擇性。 ScriptType = FilePath時使用 。

指定要執行之 PowerShell 腳本的路徑。 可包含通配符和變數。 範例: $(system.defaultworkingdirectory)/**/drop/projectartifacts/**/docker-compose.yml.

備註

在這項工作中不支持合併 Compose 檔案。


Inline - 內嵌腳本
string。 選擇性。 ScriptType = InlineScript時使用 。 預設值:# You can write your PowerShell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments

指定要在組建代理程式上執行的 PowerShell 命令。 深入瞭解 PowerShell 工作。


ScriptArguments - 腳本自變數
string

指定要傳遞至 PowerShell 的其他參數。 可以是序數或具名參數。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性

輸出變數

沒有。

備註

使用此工作在 Azure Service Fabric 叢集連線的內容中執行 PowerShell 腳本。 在已初始化 Service Fabric 叢集連線的 PowerShell 工作階段中執行任何 PowerShell 命令或腳本。

Service Fabric

需求

要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 自我裝載代理程式必須具有 功能, 符合下列 需求, 執行使用此工作的作業: Cmd
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 1.95.0 或更新
工作類別 效用