2017-10-09 543 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')