Set “Path” environment variable during vsts build so it would persist across build tasks specifically vsTest task

前端 未结 2 1876
小蘑菇
小蘑菇 2020-12-19 03:46

I have a vsts build definition in which I try to set the PATH environment variable using PowerShell (and before I tried cmd) task, so that in a later vsTest task, the tests

相关标签:
2条回答
  • 2020-12-19 04:11

    Set the process environment variable by calling logging command through PowerShell task:

    For example:

    Write-Host "##vso[task.setvariable variable=PATH;]${env:PATH};$newPath";
    
    0 讨论(0)
  • 2020-12-19 04:14

    If you need to do this in a Linux pipeline you can do the following:

    - script: echo "##vso[task.setvariable variable=PATH]${PATH}:<your new path here>"

    0 讨论(0)
提交回复
热议问题