ServiceFabricPowerShell@1 - Service Fabric PowerShell v1 工作

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

Syntax

# 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.
# Service Fabric PowerShell v1
# Run a PowerShell script within 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. 必要。

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


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

  • 此工作會使用 Service Fabric 安裝來連線並部署至 Service Fabric 叢集。
  • 組建代理程式上的 Azure Service Fabric Core SDK

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
在上執行 Agent、DeploymentGroup
要求 自我裝載代理程式必須具備符合下列需求的功能,才能執行使用此工作的作業:Cmd
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
可設定變數 任何
代理程式版本 1.95.0 或更新版本
工作類別 公用程式