gpt4 book ai didi

powershell - 尝试通过 powershell : cannot connect to remote server 安装巧克力时出错

转载 作者:行者123 更新时间:2023-12-04 17:43:19 24 4
gpt4 key购买 nike

我正在尝试按照官方文档( https://chocolatey.org/install )安装巧克力,这就是我正在做的:

1-I am opening a cmd.exe running as administrator
2-I am running the following command : powershell and then switch into powershell mode
3-I am running the following command : $PSVersionTable.PSVersion and then get the following result : major:5 minor:1 build:16299 revision:785
4-I am running the following command : Get-ExecutionPolicy and then get the following result : RemoteSigned
5-I am running the following command : Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('http
s://chocolatey.org/install.ps1')) and get the following error :

Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
At line:1 char:51
+ ... ess -Force; iex ((New-Object System.Net.WebClient).DownloadString('ht ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException

我在一家公司工作(我们的操作系统是 Windows 10 企业版),在尝试或任何同事的机器时,它运行良好,并且(从我们所见)他们和我之间没有任何配置差异。

提前致谢

最佳答案

您尝试的代码没有任何问题。基本上,它告诉您无法连接,这可能是限制或策略。请尝试以下操作:

$req = [System.Net.HttpWebRequest]::Create("https://www.google.com") 
$req.Proxy = [System.Net.WebRequest]::DefaultWebProxy
$req.Proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

然后再次运行注释。它与 Windows 10 中用于请求的凭据有关。

关于powershell - 尝试通过 powershell : cannot connect to remote server 安装巧克力时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53390523/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com