-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy Support #8
Comments
What do you think ? |
@BenAffleckIsBatman thanks for your suggestions. Your are right, the PackageManagement DSC takes additionalparameters that can be passed down to its providers. And the providers need to implement to take these parameters in install-package, save-package etc. In the ChocolateyGet case, are you thinking to add proxyurl, proxy url, proxyCredential? Also I am open to take PR. Do you have any bandwidth to do so? |
@jianyunt I would love to help. Put that on my list. I struggled with a good debug setup for these situations. I asked on StackOverflow a while ago. Could you answer it and tell something about the best way to debug & unit test? Specially how to construct the PackageManagement object passed down to the implementation. Any advise ? |
Just posted it in StackOverflow. I created it a while back using ISE. |
Make builds and tests more robus to previous failures/kills
@sebastianzolg my pull request (#15) introduces default behavior that invokes Chocolatey's native API that's bundled into the provider, so it no longer tries to install / upgrade choco.exe unless API support is expressly disabled or used with PowerShell 7+, which should alleviate the need to pass in proxy settings for downloading Choco.exe through DSC arguments. |
When using ChocolateyGet behind a proxy server, in some situations its not working.
While choco.exe can be easily configured to use a proxy https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey#explicit-proxy-settings, the ChocolateyGet Module can't.
Function Install-ChocoBinaries uses Invoke-WebRequest at some point, which doesn't work behind a proxy server per default. While this is not a big deal when using ChocolateyGet in normal PS1 Scripts, as we can set the proxy using [system.net.webrequest]::defaultwebproxy globally, this is not possible when using ChocolateyGet within a PowerShell DSC Configuration as LCM has no option to set a proxy, as far as I know.
That means, there is no way to make it work within a DSC Configuration behind a proxy.
Recommendation: Allow the ChocolateyGet Module to receive AdditionalParameters, so it can be set using the same approach as other package providers, e.g. NuGet https://github.com/PowerShell/PackageManagementProviderResource/blob/master/Examples/Sample_Install_Package_Using_NuGet.ps1 > Note the AdditionalParameters Dictionary, that can be passed.
thanks
The text was updated successfully, but these errors were encountered: