如何使用文件Chocolatey.0.10.15.nupkg安装Chocolatey



我在带有Chocolatey链接的PowerShell控制台中出现错误。

巧克力链接错误

如果没有解决方案,我需要学习如何安装Chocolatey与下载的文件";巧克力0.10.15.nupkg";。

巧克力档案

安装choco是一个非常常见的用例,包括NuGet。

PowerShell已经附带了一个使用NuGet的包管理器,默认情况下它已经安装了该管理器。由于其他原因,您仍然可以安装choco,但对于每天正常使用的PowerShell,不需要它。

安装PowerShellGethttps://learn.microsoft.com/en-us/powershell/scripting/gallery/installing-psget?view=powershell-7

PowerShellGet是以下版本Windows 10中的内置模块或更新的Windows Server 2016或更新的Windows管理框架(WMF(5.0或更新的PowerShell 6

在PowerShell会话中设置安全级别。

# Required for use with web SSL sites
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

如果ExecutionPolicy设置为AllSigned,则必须对运行的任何脚本进行签名。否则,请在用户会话中将ExecutionPolicy设置为RemoteSigned或ByPass。

如何使用PowerShell 安装巧克力

Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression (
(New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')
)

最新更新