ZZZSharePoint
ZZZSharePoint

Reputation: 1341

Debugging in Azure DevOps Yaml Pipeline

I have below PowerShell script in my Yaml pipeline, where I am trying to add Path in environmental variable Path, I am not getting any error but my test cases is failing which is dependent on one of the path variable I am setting below.

Is there a way if I can debug and see what all path has been added to my path variable below. If yes how can I see it?? as my test cases pass locally when setting the path env variable.

- powershell: |
      Set-Variable -Name PATH -Value "$env:PATH;$(IppRoot)\redist\intel64_win\ipp;$(Build.SourcesDirectory)\Project_x64-$(osSuffix)\bin;$(Build.BinariesDirectory);$(LibFT4222Root)/imports/LibFT4222/dll/amd64"
      Write-Host "##vso[task.setvariable variable=PATH]$PATH"
      displayName:  'Add binaries to PATH on Win'
      condition:    eq(variables['Agent.OS'], 'Windows_NT')

Upvotes: 3

Views: 1691

Answers (1)

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41545

You can add another step after it and just print all the environment variables:

- task: CmdLine@2
  inputs:
    script: 'set'

Now you can check if it's indeed added to the Path in the previous task.

By the way, to add a new value to the PATH you can use a special logging command:

Write-Host ##vso[task.prependpath]c:\my\directory\path

Upvotes: 2

Related Questions