我正在按照Chocolately Install步骤(Windows 7),但是遇到了两个问题。
首先,我已经打开了[[命令提示符(用以管理员身份运行将其打开),但是当尝试执行Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
时,出现此错误:
未捕获的语法错误:意外的标识符
..突出显示我命令的https:
部分。
此外,当我尝试执行Get-ExecutionPolicy
时,结果为:
未捕获的ReferenceError:未定义Get
任何想法有什么问题吗?
*更新*
当我在PowerShell
中尝试相同的命令时,出现此错误:PS C:\ Users \ mylogin> Set-ExecutionPolicy绕过-Scope Process -Force;[System.Net.ServicePointManager] :: SecurityProtoc ol =[System.Net.ServicePointManager] :: SecurityProtocol -bor 3072;进出口(((新对象System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))例外设置“ SecurityProtocol”:“无法将值” 3312“转换为类型由于无效的枚举值,导致出现“ System.Net.SecurityProtocolType”。指定以下枚举值之一,然后重试。的可能的枚举值为“ Ssl3,Tls”。“在第1行char:85+ Set-ExecutionPolicy绕过-作用域处理-强制; [System.Net.ServicePointManager] :: <<<< SecurityProtocol = [系统。Net.ServicePointManager] :: SecurityProtocol -bor 3072; iex((新对象System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))+ CategoryInfo:InvalidOperation:(:) [],RuntimeException+ FullyQualifiedErrorId:PropertyAssignmentException使用“ 1”作为参数调用“ DownloadString”的异常:“基础连接已关闭:发生意外错误发送。”在线:1字符:219+ Set-ExecutionPolicy绕过-作用域处理-强制; [System.Net.ServicePointManager] :: SecurityProtocol = [System.Net.ServicePointManager] :: SecurityProtocol -bor 3072; iex((新对象System.Net.WebClient).DownloadString <<<https://chocolatey.org/install.ps1'))+ CategoryInfo:未指定:(:) [],MethodInvocationException+ FullyQualifiedErrorId:DotNetMethodException
System.Net.WebClient).DownloadString ('https://chocolatey.org/install.ps1')) Exception setting "SecurityProtocol": "Cannot convert value "3312" to type "System.Net.SecurityProtocolType" due to inv alid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "Ssl3, Tls"
我之前链接到的博客文章中的部分应该有所帮助:如果您发现自己置备计算机,例如Windows 7,Windows Server 2008或更早版本,则在实施此更改后,您将发现这些计算机将无法与Chocolatey Community Repository通信。在这些情况下,您需要将alternative installation methods用于Chocolatey。我们强烈建议使用offline Chocolatey installation,因为它具有最大的灵活性和可靠性。在Chocolatey install page上列出了要求: