本文主要是介绍windows安装 Chocolatey(巧克力/choco),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前言
- win7
- win7 自带 powershell v2,需要升级 powershell 才能安装成功。
Chocolatey
Chocolatey是一个Windows上的包管理器,类似于linux上的yum和 apt-get。
其官网为:https://chocolatey.org
查看 powershell 版本
- 打开powershell
- 输入命令
get-host
powershell > get-hostName : ConsoleHost
Version : 5.1.19041.1023
InstanceId : e6f09492-0b1b-48ef-8c43-e419bc8fda9e
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : zh-CN
CurrentUICulture : zh-CN
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
或者
- 打开powershell
- 输入命令
$PSVersionTable
powershell > $PSVersionTableName Value
---- -----
PSVersion 5.1.19041.1023
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1023
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
升级 powershell
参考:https://docs.microsoft.com/zh-cn/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell
安装 Chocolatey
如果升级了 powershell , 按照安装文档安装 Chocolatey 。
安装文档 https://chocolatey.org/install
安装测试
cmd> choco -v
0.10.15
这篇关于windows安装 Chocolatey(巧克力/choco)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!