It seems that request is blocked by network policies/firewall/proxy.
You can run docker image with powershell ping
command to check if dist.nuget.org
is accessible in docker scope:
docker run --rm mcr.microsoft.com/windows/servercore:1903 powershell ping dist.nuget.org
Pinging cs2.wpc.gammacdn.net [152.199.23.209] with 32 bytes of data:
Reply from 152.199.23.209: bytes=32 time=16ms TTL=55
Reply from 152.199.23.209: bytes=32 time=10ms TTL=55
Reply from 152.199.23.209: bytes=32 time=9ms TTL=55
Reply from 152.199.23.209: bytes=32 time=9ms TTL=55
Ping statistics for 152.199.23.209:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 9ms, Maximum = 16ms, Average = 11ms
If ping failed - check your network policies/firewall/proxy.
If ping is succesfull - it can be old TLS version enabled as a default (by default PowerShell will use TLS 1.0 when using Invoke-WebRequest).
Try to add:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
in the beginning of the up.ps1
.