Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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')
like image 694
ZZZSharePoint Avatar asked Jan 24 '26 16:01

ZZZSharePoint


1 Answers

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
like image 143
Shayki Abramczyk Avatar answered Jan 28 '26 03:01

Shayki Abramczyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!