I've tested the DockerMsftProvider in a VM with a simulated slow network connection and could reproduce the problem that the ZIP file isn't downloaded.
Looking closer it turns out that retrieving the download size is the problem. This has downloaded the whole zip file and then we retrieved the size.
This PR does a HEAD request to just retrieve the header and not the whole file.
With the simulated 4MBit connection the download takes about 6-8 minutes and Invoke-WebRequest does a good job.
I've tested the DockerMsftProvider in a VM with a simulated slow network connection and could reproduce the problem that the ZIP file isn't downloaded. Looking closer it turns out that retrieving the download size is the problem. This has downloaded the whole zip file and then we retrieved the size. This PR does a HEAD request to just retrieve the header and not the whole file.
With the simulated 4MBit connection the download takes about 6-8 minutes and
Invoke-WebRequest
does a good job.Fixes #15 Fixes MicrosoftDocs/Virtualization-Documentation#919
Credits: Thanks @InteXX for showing me https://github.com/OneGet/MicrosoftDockerProvider/issues/15#issuecomment-310871007 which helped me to find the root cause of the problem.