Chocolatey 是 Windows 的包管理器,适合在 VPS 上通过命令行批量、静默安装软件。
前提条件
- 以管理员身份运行 PowerShell
PowerShellSet-ExecutionPolicy Bypass -Scope Process -Force
安装
PowerShell[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
重新打开 PowerShell 后验证:
PowerShellchoco -v
示例
PowerShellchoco install git -y choco install 7zip -y choco upgrade all -y
Chocolatey 为第三方生态,安装前请在社区源核对软件包说明。