2017-10-09 545 views
1

我想在Windows 7  使用Windows PowerShell在我的办公室安装东张西望,但它给下面的错误:无法在代理设置下在Windows 7中安装Scoop,并发出异常?

Exception calling "Download String" with "1" argument(s):"The remote server returned and error :(407) proxy authentication is required."

我已经进入一个PowerShell控制台下面的命令:

 
PS>Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 

Execution Policy Change 
The execution policy helps protect you from scripts that you do not trust. 
Changing the execution policy might expose you to the security risks described 
in the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/ 
?LinkID=135170. Do you want to change the execution policy? 
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y 
PS>iex (New-Object Net.WebClient).DownloadString('https://get.scoop.sh') 
+0

共享与我们的代码将是有益的! – gvee

+0

显然,您通过需要身份验证的代理进行连接,您的代码不提供该代理。 –

+0

请检查问题,我已经添加了有关步骤的更多详细信息 –

回答

1
  1. 确保您的默认浏览器可以去https://get.scoop.sh,这意味着你必须有效的代理设置来访问该网站。

  2. 输入如下:

    PS> $wc = new-object net.webclient 
    PS> $wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials 
    PS> iex $wc.downloadstring('https://get.scoop.sh')