I am currently using Chocolatey in conjunction with Ansible to roll out a number of applications to a mixed Windows/Linux environment.
All the Windows machines, bar one are running as server core installations, and for all the machines except the one with a GUI installed, Chocolatey will not install any applications as it fails to use the proxy.
I have set the proxy environment variables using netsh:
PS C:\Windows\system32> netsh winhttp show proxy
Current WinHTTP proxy settings:
Proxy Server(s) : http://aaa.bbb.ccc.ddd:3128
Bypass List : <local>;localhost;127.0.0.1;172.16.*;192.168.*;*.domain.local;
Also in %APPDATA%\NuGet\NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="HTTP_PROXY" value="http://aaa.bbb.ccc.ddd:3128" />
</config>
</configuration>
However, when Powershell scripts scripts call $webclient = new-object System.Net.WebClient the proxy element of this object returns nothing:
PS C:\Windows\system32> $webclient = new-object System.Net.WebClient
PS C:\Windows\system32> $webclient.Proxy
Credentials
-----------
I've found that if I manually force the code within functions/Get-Headers.ps1 and functions/Get-webFiles.ps1 to use the proxy then the installs work, however this is not a great workaround to the problem as my Ansible tasks are now fixed to a specific version of chocolatey where I know the workaround works.
Does anyone have any other ideas/solutions to try?
Choco series 0.9.9+ was a total rewrite and hasn't implemented all the things yet, including proxy support out of what you set in IE.
Watch issue https://github.com/chocolatey/choco/issues/243 to know when it available again.
Update: proxy support is in Chocolatey now - see https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey