【发布时间】:2020-03-12 16:25:07
【问题描述】:
不能从 Azure PowerShell 任务的脚本中调用脚本吗?
背景 -
我有一个 Azure 存储库,其中包含两个脚本(我们称它们为 script0 和 script1)。没有构建正在进行,因此没有构建管道。只有一个发布管道。它从中获取的工件是 Azure Repository Git。我在(发布)管道中只有一项任务,它是 Azure PowerShell 任务。
在主脚本 script0 中,我有一个 for 循环,它需要我运行 script1(除了在循环)。
对于我的一生,我无法弄清楚如何才能实现这一目标。最糟糕的是,它在本地工作。此外,其他一切都在循环中工作。我已经尝试了很多方法来修复它,但我现在就从这个开始:运行时抛出的错误
$TeamFoundationCollectionUri$TeamProject/testscript.ps1 $stage $FunctionHosts[$i] (($hashtable | select -First 6).Key[$i]) $ResourceGroupName $location $functionApps $AdminClientSecret $VaultName $JsonFile
(现在,请注意 - 这是 script0 的一部分 - 主脚本)。
这是错误:
模糊区域是script0,testscript.ps1是script1
我几乎什么都试过了
- 使用呼叫运算符 &
- 使用 \, /, //
- 调用表达式-命令“code here>”
- 调用命令
- 也试过 powershell.exe -Command code here>
如您所知,这些都不起作用。
【问题讨论】:
标签: powershell azure-devops azure-powershell