使用此工作在 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
-
叢集服務連線
輸入別名:serviceConnectionName
。
string
。 必須的。
指定執行指定的 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
- 此工作會使用 Service Fabric 安裝來連線並部署至 Service Fabric 叢集。
- 組建代理程式上的 Azure Service Fabric Core SDK。