【发布时间】:2020-12-14 02:50:04
【问题描述】:
大家好,我正在开发 ymal 发布管道,我有两个 PowerShell 脚本。 测试1.ps1 test2.ps1
步骤 1) 在 test1.ps1 中,我使用 :
设置输出变量$link="google.com"
Write-Host "##vso[task.setvariable variable=packageurl]$link"
步骤 2) 现在我想在 test2.ps1 脚本中使用这个 pacakgeurl 变量值。
Ymal 代码如下所示:
- task: AzurePowerShell@3
displayName: 'Query Latest Package'
inputs:
azureSubscription: 'test1'
ScriptType: FilePath
ScriptPath: 'source\test1.ps1'
- task: PowerShell@2
displayName: 'Download package'
inputs:
targetType: filePath
filePath: 'source\test2.ps1'
所以基本上我必须通过 PowerShell 脚本使用从 1 个任务到 2 个任务的输出变量值。
谁能帮我解决这个问题..?
提前致谢。
【问题讨论】:
-
你是如何引用 test2.ps1 中的变量的?
标签: powershell azure-devops yaml azure-pipelines