mmajcica / win-rm-file-copy

Windows Machine File Copy Build-Release task for VSTS/TFS based on WinRM
MIT License
1 stars 2 forks source link

Not work behind Corporate Proxy #14

Open deka opened 4 years ago

deka commented 4 years ago

Hi, Not working behind corporate proxy. Can you use HTTP_PROXY, HTTPS_PROXY et NO_PROXY ? doc Or .proxy et .proxybypass ? doc Regards

mmajcica commented 4 years ago

@deka I'm aware of all of this, proxy environment variables, agent proxy lists, custom certificates, and all of the other details that can be fetch from the environment or fetch from the task library. Unfortunately this is powershell and the functionality is based on the already available features inside the Session object/commandlets and Copy-Item cmdlet. Getting these to play well with a proxy it ain't no easy task. The way to go would be to create a New-PSSessionOption object to pass as parameter to the New-PSSession invocation. New-PSSessionOption offers a parameter called ProxyAccessType that could be set to WinHttpConfig and leveraged for something like this. More information can be found here https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.remoting.proxyaccesstype?redirectedfrom=MSDN&view=powershellsdk-1.1.0 This said, I never tried it nor I do have time at this moment to tackle something like this. However I would be more then happy to receive a contribution from your side, considering you have the infrastructure where you could test this. I could assist for any necessary guidance and merge a PR quickly, bringing this new feature to production in no time.