I am trying to run a powershell script on Microsoft hosted agent "windows-latest", It uses below az cli command:
$projects = az devops project list --organization "https://dev.azure.com/$org_name/" --output json | ConvertFrom-Json
When I am running this on pipeline I am getting below error:
##[error]WARNING: Unable to encode the output with cp1252 encoding. Unsupported characters are discarded.
What have i tried:
[Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
-
az devops project list --organization "https://dev.azure.com/k-c" 3>$null $env:PYTHONIOENCODING = 'utf-8'
Tried running the same script on other windows images, self hosted agents but same issue.
This is breaking my entire pipeline and I have been stuck with it quite some time. Please help.