Debugging Azure DevOps YAML Builds and Deployments
One simple YAML task in Azure DevOps can write out your Powershell environment super quickly.

I could make this post a lot longer, but I'm keeping it simple because it comes up all the time. The number of people who have smiled as a thanks to this tiny script is great:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Env Variables"
dir env:
May that save you hours of heartache.