Install Chocolatey on a windows machine

As you know, Chocolatey is a very known and useful package manager for windows. Chef, Puppet, Boxstarter, PowerShell DSC, Ansible, Saltstack, Microsoft, etc all have ways for using Chocolatey to ensure the state of a computer and packages installed. If you don’t know about package manager, see my blog post here.

There are more than few ways to install it.One of the easiest ways is to use the built in package management inside PowerShell:

Install-Package chocolatey

You can also use NuGet command line to download Chocolatey:

nuget install chocolatey or nuget install chocolatey -pre

Once you download it, open PowerShell (remote unsigned), navigate to the tools folder and run:

& .\chocolateyInstall.ps1

Or, if you want to use old fashined PowerShell, use this command:

iwr -UseBasicParsing | iex

which should work on PowerShell v3 or higher.

You can also use below command on a command prompt:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(''))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Needless to say, you need to have internet access on the machine, you are doing this.

Below is output you should get:

Installing Chocolatey

Once you have installed it, you can get  help using choco /? command.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s