• Trace:

This is an old revision of the document!


chocolatey

win7/2008r2 prerequisites

cmd-admin

  • Win-R → cmd → Ctrl-Shift-Enter
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

powershell-admin

  • Win-R → poweshell → Ctrl-Shift-Enter
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

config chocolatey

choco feature enable -n allowGlobalConfirmation
choco feature enable -n useRememberedArgumentsForUpgrades

install

choco install 7zip.commandline wget curl aria2 sudo which
 
choco install wget --ignore-checksums        # ignore checksums
choco list -lo                               # list locally installed packages
choco outdated                               # list outdated packages

uninstall

choco uninstall <package>                              ## normal uninstall
choco uninstall <package> --force                      ## force uninstall
choco uninstall <package> -n -skipautouninstaller      ## delete a package in choco

upgrade

choco upgrade chocolatey   ## upgrade itself
choco upgrade all          ## upgrade all
choco upgrade wget         ## upgrade single package

pin

choco pin
choco pin list
choco pin add -n=git
choco pin add -n=git --version 1.2.3
choco pin remove --name git

clean up

choco install choco-cleaner
choco-cleaner

use proxy

choco config set proxy http://localhost:8888
choco config set proxyUser username
choco config set proxyPassword password
pub/chocolatey.1636356642.txt.gz · Last modified: 2021/11/08 07:30 by derek