用Choco安装和管理windows应用程序的八项高频操作

1.如何求助?起手式 , 核心的一点是寻求帮助 。 choco与正常的linux命令查询大相径庭 。
比如scoop的查询是这样的:
PS C:\Users\gaowei\Videos\BibleProject> scoop help updateUsage: scoop update[options]'scoop update' updates Scoop to the latest version.'scoop update ' installs a new version of that app, if there is one.You can use '*' in place ofto update all apps.Options:-f, --forceForce update even when there isn't a newer version-g, --globalUpdate a globally installed app-i, --independentDon't install dependencies automatically-k, --no-cacheDon't use the download cache-s, --skipSkip hash validation (use with caution!)-q, --quietHide extraneous messages但是choco却将help放置在了后面 , 而且还是single-dash , 既然如此也便只能“客随主便”了 。
PS C:\Users\gaowei\Videos\BibleProject> choco list -helpChocolatey v0.10.15List/Search CommandChocolatey will perform a search for a package local or remote. Some may prefer to use `clist` as a shortcut for `choco list`. 2.安装软件安装案例如下:
choco install sysinternalschoco install notepadplusplus googlechrome atom 7zipchoco install notepadplusplus --force --force-dependencieschoco install notepadplusplus googlechrome atom 7zip -dvfychoco install git -y --params="'/GitAndUnixToolsOnPath /NoAutoCrlf'"choco install git -y --params="'/GitAndUnixToolsOnPath /NoAutoCrlf'" --install-arguments="'/DIR=C:\git'"# Params are package parameters, passed to the package# Install args are installer arguments, appended to the silentArgs#in the package for the installer itselfchoco install nodejs.install --version 0.10.35choco install git -s "'https://somewhere/out/there'"choco install git -s "'https://somewhere/protected'" -u user -p pass3.查阅已安装的软件【用Choco安装和管理windows应用程序的八项高频操作】查阅已安装的软件 , 不能直接输入命令:
PS C:\Users\gaowei\Videos\BibleProject> choco listChocolatey v0.10.15系统会始终处于pending的状态 。 解决方案必须加上options:
choco list --local-onlychoco list -lichoco list -laichoco list --page=0 --page-size=25choco search gitchoco search git --source="'https://somewhere/out/there'"choco search bob -s "'https://somewhere/protected'" -u user -p pass4.列出所有过期的软件升级apps前 , 先检查是否已经过期 。
PS C:\Users\gaowei\scoop\apps\scoop\current> choco outdatedChocolatey v0.10.15Outdated Packages Output is package name | current version | available version | pinned?adobereader|2020.012.20043|2020.012.20048|falsecalibre|4.23.0|5.3.0|falsedotnetcore3-desktop-runtime|3.1.8|3.1.9|falseKB2533623|1.0.4|2.0.0|falsemicrosoft-edge|84.0.522.63|86.0.622.56|falsepowertoys|0.21.1|0.25.0|falsevcredist140|14.26.28720.3|14.27.29112|falsevisualstudio2017buildtools|15.9.26.0|15.9.28.0|false5.升级软件升级全部的安装程序:
PS C:\Users\gaowei\Videos\BibleProject> sudo choco upgrade all -yChocolatey v0.10.15Upgrading the following packages:allBy upgrading you accept licenses for the packages.7zip v19.0 is the latest version available based on your source(s).7zip.install v19.0 is the latest version available based on your source(s).You have adobereader v2020.012.20043 installed. Version 2020.012.20048 is available based on your source(s).Progress: Downloading adobereader 2020.012.20048... 100%adobereader v2020.012.20048 [Approved]adobereader package files upgrade completed. Performing other installation steps.TrueTrueUsing system proxy server '127.0.0.1:57356'.Downloading adobereaderfrom ''Using system proxy server '127.0.0.1:57356'.Progress: 22% - Saving 59.37 MB of 261.05 MB升级部分程序的方法:
choco upgrade chocolateychoco upgrade notepadplusplus googlechrome atom 7zipchoco upgrade notepadplusplus googlechrome atom 7zip -dvfychoco upgrade git -y --params="'/GitAndUnixToolsOnPath /NoAutoCrlf'"choco upgrade git -y --params="'/GitAndUnixToolsOnPath /NoAutoCrlf'" --install-args="'/DIR=C:\git'"# Params are package parameters, passed to the package# Install args are installer arguments, appended to the silentArgs#in the package for the installer itselfchoco upgrade nodejs.install --version 0.10.35choco upgrade git -s "'https://somewhere/out/there'"choco upgrade git -s "'https://somewhere/protected'" -u user -p passchoco upgrade allchoco upgrade all --except="'skype,conemu'"6.卸载软件可以卸载软件的指定版本:
choco uninstall gitchoco uninstall notepadplusplus googlechrome atom 7zipchoco uninstall notepadplusplus googlechrome atom 7zip -dvchoco uninstall ruby --version 1.8.7.37402choco uninstall nodejs.install --all-versions比如卸载adobe-reader:
PS C:\Users\gaowei\Videos\BibleProject> sudo choco uninstall adobereaderChocolatey v0.10.15Uninstalling the following packages:adobereaderadobereader v2020.012.20048The package adobereader wants to run 'chocolateyuninstall.ps1'.Note: If you don't run this script, the installation will fail.Note: To confirm automatically next time, use '-y' or consider:choco feature enable -n allowGlobalConfirmationDo you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y Running auto uninstaller... Auto uninstaller has successfully uninstalled adobereader or detected previous uninstall. adobereader has been successfully uninstalled.