【发布时间】:2020-12-01 15:48:45
【问题描述】:
我正在编写脚本,我想从第一个脚本中获取结果并相应地运行第二个脚本。
这是我的第一个脚本 -
$result = <command 1>
if($result)
{
< run command 2>
return $true
}
else
{
return
$false
}
这是第二个脚本
if($return -eq $true)
{
<run Command 3>
}
else{
<run command 4>
}
我在 Azure Devops 中有 2 个单独的任务来执行这 2 个脚本。
我在管道和输出变量中使用 Azure PowerShell 任务 - 返回
Que - 第一个脚本运行良好。它返回 true 或 false 值,但第二个脚本不起作用。它只是执行 else 条件是从第一个脚本返回值是真还是假。 如何根据第一个脚本返回的真假结果使第二个脚本工作
【问题讨论】:
-
嗨@megha。您能否检查答案是否可以解决此问题?如果您有任何问题,请随时告诉我。只是提醒this。
标签: powershell azure-devops azure-powershell