程序员人生 网站导航

Windows上的巧克力味Chocolatey详解

栏目:服务器时间:2016-07-04 08:45:11

Windows上的巧克力味Chocolatey详解

作者:chszs,未经博主允许不得转载。经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs

Chocolatey是甚么?很简单,Chocolatey就是Windows系统的yum或apt-get。

1、Chocolatey介绍

Chocolatey是1款专为Windows系统开发的、基于NuGet的包管理器工具,类似于Node.js的npm,MacOS的brew,Ubuntu的apt-get,它简称为choco。Chocolatey的设计目标是成为1个去中心化的框架,便于开发者按需快速安装利用程序和工具。

Chocolatey的官网: https://chocolatey.org/

Chcocolatey当前最新版本为0.9.10.3版。

2、Chocolatey安装

要安装Chocolatey很容易,必须以管理员权限打开cmd.exe命令行提示,履行以下内容:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

还有1种安装方法,使用PowerShell,一样必须以管理员权限打开PowerShell,履行以下命令:

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

3、Chocolatey用法

1、命令

  • search - 搜索包 choco search something
  • list - 列出包 choco list -lo
  • install - 安装 choco install baretail
  • pin - 固定包的版本,避免包被升级 choco pin windirstat
  • upgrade - 安装包的升级 choco upgrade baretail
  • uninstall - 安装包的卸载 choco uninstall baretail
  • 安装Ruby Gem - choco install compass -source ruby
  • 安装Python Egg - choco install sphynx -source python
  • 安装IIS服务器特性 - choco install IIS -source windowsfeatures
  • 安装Webpi特性 - choco install IIS7.5Express -source webpi

2、经常使用的1些命令

1)列出本地已安装的包

choco list --local-only

2)列出Windows系统已安装的软件

choco list -li

或使用

choco list -lai

3)升级所有已安装的包

choco upgrade all -y

4、Chocolatey的文件

tools\chocolateyInstall.ps1
tools\chocolateyInstall\choco.exe
tools\chocolateyInstall\choco.exe.ignore
tools\chocolateyInstall\helpers\chocolateyInstaller.psm1
tools\chocolateyInstall\helpers\chocolateyScriptRunner.ps1
tools\chocolateyInstall\helpers\functions\Get-BinRoot.ps1
tools\chocolateyInstall\helpers\functions\Get-CheckSumValid.ps1
tools\chocolateyInstall\helpers\functions\Get-ChocolateyUnzip.ps1
tools\chocolateyInstall\helpers\functions\Get-ChocolateyWebFile.ps1
tools\chocolateyInstall\helpers\functions\Get-EnvironmentVariable.ps1
tools\chocolateyInstall\helpers\functions\Get-EnvironmentVariableNames.ps1
tools\chocolateyInstall\helpers\functions\Get-FtpFile.ps1
tools\chocolateyInstall\helpers\functions\Get-ProcessorBits.ps1
tools\chocolateyInstall\helpers\functions\Get-UACEnabled.ps1
tools\chocolateyInstall\helpers\functions\Get-VirusCheckValid.ps1
tools\chocolateyInstall\helpers\functions\Get-WebFile.ps1
tools\chocolateyInstall\helpers\functions\Get-WebHeaders.ps1
tools\chocolateyInstall\helpers\functions\Install-BinFile.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyDesktopLink.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyEnvironmentVariable.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyExplorerMenuItem.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyFileAssociation.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyInstallPackage.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyPackage.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyPath.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyPinnedTaskBarItem.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyPowershellCommand.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyShortcut.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyVsixPackage.ps1
tools\chocolateyInstall\helpers\functions\Install-ChocolateyZipPackage.ps1
tools\chocolateyInstall\helpers\functions\Set-EnvironmentVariable.ps1
tools\chocolateyInstall\helpers\functions\Start-ChocolateyProcessAsAdmin.ps1
tools\chocolateyInstall\helpers\functions\Test-ProcessAdminRights.ps1
tools\chocolateyInstall\helpers\functions\Uninstall-BinFile.ps1
tools\chocolateyInstall\helpers\functions\Uninstall-ChocolateyPackage.ps1
tools\chocolateyInstall\helpers\functions\UnInstall-ChocolateyZipPackage.ps1
tools\chocolateyInstall\helpers\functions\Update-SessionEnvironment.ps1
tools\chocolateyInstall\helpers\functions\Write-ChocolateyFailure.ps1
tools\chocolateyInstall\helpers\functions\Write-ChocolateySuccess.ps1
tools\chocolateyInstall\helpers\functions\Write-FileUpdateLog.ps1
tools\chocolateyInstall\LICENSE.txt
tools\chocolateyInstall\redirects\choco.exe
tools\chocolateyInstall\redirects\choco.exe.ignore
tools\chocolateyInstall\redirects\chocolatey.exe
tools\chocolateyInstall\redirects\chocolatey.exe.ignore
tools\chocolateyInstall\redirects\cinst.exe
tools\chocolateyInstall\redirects\cinst.exe.ignore
tools\chocolateyInstall\redirects\clist.exe
tools\chocolateyInstall\redirects\clist.exe.ignore
tools\chocolateyInstall\redirects\cpack.exe
tools\chocolateyInstall\redirects\cpack.exe.ignore
tools\chocolateyInstall\redirects\cpush.exe
tools\chocolateyInstall\redirects\cpush.exe.ignore
tools\chocolateyInstall\redirects\cuninst.exe
tools\chocolateyInstall\redirects\cuninst.exe.ignore
tools\chocolateyInstall\redirects\cup.exe
tools\chocolateyInstall\redirects\cup.exe.ignore
tools\chocolateyInstall\redirects\cver.exe
tools\chocolateyInstall\redirects\cver.exe.ignore
tools\chocolateyInstall\redirects\RefreshEnv.cmd
tools\chocolateyInstall\tools\7za.exe
tools\chocolateyInstall\tools\7za.exe.ignore
tools\chocolateyInstall\tools\7za.exe.manifest
tools\chocolateyInstall\tools\7zip.license.txt
tools\chocolateyInstall\tools\checksum.exe
tools\chocolateyInstall\tools\checksum.exe.ignore
tools\chocolateyInstall\tools\checksum.license.txt
tools\chocolateyInstall\tools\shimgen.exe
tools\chocolateyInstall\tools\shimgen.exe.ignore
tools\chocolateyInstall\tools\shimgen.license.txt
tools\chocolateysetup.psm1
tools\init.ps1

5、最近升级

最近我从Chocolatey 0.9.9.11版升级到0.9.10.3版,发现360安全卫士报了1个木马。自动清除木马,依然升级成功。不影响使用。还未深究其缘由。
这里写图片描述

写在最后

我新建了1个微信个人公众号,博客的信息也会在公众号同步更新。关注随便。
这里写图片描述

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐