0

I want to install scoop on a laptop on which I do not have administrator rights. I use the following commands in PowerShell:

PS> Set-ExecutionPolicy RemoteSigned -scope CurrentUser
PS> iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Exception calling "DownloadString" with "1" argument(s): "The operation has timed out"
At line:1 char:1
+ iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

I believe this is due to it using IPv6 by default instead of IPv4:

PS> ping get.scoop.sh
Pinging d19x8hxthvia8.cloudfront.net [2600:9000:2002:7200:1f:b80:d400:93a1] with 32 bytes of data:
General failure.
General failure.
PS> ping -4 get.scoop.sh
Pinging d19x8hxthvia8.cloudfront.net [52.85.245.136] with 32 bytes of data:
Reply from 52.85.245.136: bytes=32 time=27ms TTL=246
Reply from 52.85.245.136: bytes=32 time=25ms TTL=246

How can I force the iex command to use IPv4 instead of IPv6?

2
  • Note that generally the OS will only prefer IPv6 if it sees that IPv6 is available to begin with. It's possible that your router has partial configuration, e.g. advertising an address prefix but not a default route. Commented Jan 11, 2019 at 11:12
  • Normally IPv6 should be working. I now noticed I can't ping Google either as it defaults to IPv6. I'll investigate whether this is due to a laptop misconfiguration or a router misconfiguration.
    – Tommiie
    Commented Jan 11, 2019 at 11:14

1 Answer 1

0

I found the following working solution:

PS> Set-ExecutionPolicy RemoteSigned -scope CurrentUser
PS> $wc = new-object net.webclient
PS> $wc.headers.add('host', 'get.scoop.sh')
PS> iex $wc.downloadstring('https://52.85.245.136')
Initializing...
Downloading...
Extracting...
Creating shim...
Adding ~\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .