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?

AJM
  • 500
Tommiie
  • 101

1 Answers1

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.
Tommiie
  • 101