是否可以从您在Azure Pipelines中创建的Powershell循环中调用测试任务 [英] Is it possible to call a Test task from the powershell loop you created in Azure Pipelines

查看:84
本文介绍了是否可以从您在Azure Pipelines中创建的Powershell循环中调用测试任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从您创建的PowerShell循环中调用测试"任务:

Is it possible to call a Test task from the PowerShell loop you created:

foreach ($i in ${{parameters.files}})
 - task: VSTest@2
  displayName: 'VsTest - testPlan'
  inputs:
    testSuite: '$i'
    testConfiguration: '$(testConfig)'

因为我尝试使用:

- ${{ each item in parameters.files }}:
- task: VSTest@2
      displayName: 'VsTest - testPlan'
      inputs:
        testSuite: '$item'
        testConfiguration: '$(testConfig)'

它不能作为并出现错误:Unexpected Values

it does not work as the and gets an error: Unexpected Values

通过下面的链接尝试使用相同的管道循环逻辑: 如何使用powershell命令的输出作为Azure管道中的参数?

Trying to use same pipelines looping logic from the link below: How to use output of a powershell command as parameters in Azure pipeline?

推荐答案

是的,您可以使用${{ variable }}引用当前变量,例如:

Yes, you can refer to the current variable with ${{ variable }}, for example:

- ${{ each item in parameters.files }}:
- task: VSTest@2
      displayName: 'VsTest - testPlan'
      inputs:
        testSuite: '${{ item }}'
        testConfiguration: '$(testConfig)'

这篇关于是否可以从您在Azure Pipelines中创建的Powershell循环中调用测试任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆