0

A windows vm is configured that is residing the proxy and I can get the response from the VM's admin powershell prompt with the following command:

Get-PSRepository

But if I issue the very same command inside the Azure Devops pipeline I get the following instead:

WARNING: MSG:UnableToDownload «https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
WARNING: Unable to download the list of available providers. Check your internet connection.
WARNING: Unable to find module repositories.
Finishing: PowerShell

I can check and get the proxy settings though from the powershell in the pipeline with the following command:

netsh winhttp show proxy
sajis997
  • 1,089
  • 1
  • 15
  • 29

1 Answers1

0

I guess you are hosting a self-host agent on the windows VM. Some tools will not automatically use the agent configured proxy settings as stated in the document Run a self-hosted agent behind a web proxy.

You can try setting an environmental variable as below at the beginning of the your powershell command to specifically set the proxy for your powershell task.

$env:http_proxy = "192.3.4.5:8080"

Please refer to this similar thread. If above script to set proxy env variable doesnot work, you can try command Set-InternetProxy -Proxy test:8080 in this blog.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43