> For the complete documentation index, see [llms.txt](https://cheatsheet.che.wf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cheatsheet.che.wf/cli/chocolatey.md).

# Chocolatey

## Installing Chocolatey

Install with cmd.exe

```
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
```

Install with PowerShell

```
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```

Source: <https://chocolatey.org/docs/installation>

## Install / Upgrade Packages

Note: Remember to run as administrator

**To install:**

```
choco install [package name]
```

```
cinst [package name]
```

**List outdated packages:**

```bash
choco outdated
```

**Upgrade all outdated packages that aren't pinned:**

```bash
choco upgrade all
```

```bash
cup all
```

**Options:**

* Install/upgrade in a specific directory: `--params="'/installLocation:""C:\tools""'"`

Install source: <https://chocolatey.org/docs/commandsinstall> Upgrade source: <https://chocolatey.org/docs/commandsupgrade>

## Pin

### Usage

```
choco pin [list]|add|remove [<options/switches>]
```

### Examples

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

Source: <https://chocolatey.org/docs/commandspin>

## List

### Usage

```bash
  choco search <filter> [<options/switches>]
```

```bash
  choco list <filter> [<options/switches>]
```

```bash
  clist <filter> [<options/switches>]
```

### Options

* Only local: `-l`, `--lo`, `--localonly`, `--local-only`
* Exact name: `-e`, `--exact`

Source: <https://chocolatey.org/docs/commandslist>
