Getting Started With Chocolatey

I have been making a slow-ish attempt to learn Chocolatey (http://www.chocolatey.org) and get to know the package manager for PowerShell. The ultimate goal is to build a script that leverages Chocolatey to rebuild my laptop occasionally.

To do that, there is a good amount of work ahead.I’ve been through the documentation for Chocolatey – http://www.chocolatey.org/docs to get started. The process is slow for sure as the job and many other things tend to keep me from spending all my time trying to perfect the laptop builder script.

What is Chocolatey?

Chocolatey is a package manager, much like apt-get for Linux, that runs on Windows. It leverages PowerShell to install packages from public repositories (or private ones), create packages for installation, and keep applications up to date. For a more detailed explanation of what Chocolatey is, and what it is not – please visit their website – https://www.chocolaty.org

Why Should I use a Package Manager?

I find the package manager route to improve the installation and maintenance process for applications on my laptop. It is far easier to run something like:

choco install visualstudiocode

to get Vscode loaded and ready to go than even visiting the website to download it. In addition, I can only download one thing at a time from the website – using HTTP. With Chocolatey, I can run

choco upgrade –all

to handle all of the updates for applications installed by chocolatey.

In addition, chocolatey can be used by management systems like Chef and Puppet to manage systems at scale and automate deployments, systems management, and overall configuration.

I encourage you to check out the website and the gallery of Chocolatey packages – the install is as simple as a snippet of PowerShell

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

As I make progress with my laptop build script, Ill work my progress into my blog – right now it is a PowerShell Module that will eventually be built out to run as a script. I started with a module to simplify the calling of chocolatey calls when they are needed – something like install-dschocopackage visualstudiocode with all of the chocolatey switches and things happening behind the scenes in PowerShell.

Disclaimer: While I have been given a license to the business version of the Chocolatey application for testing, Chocolatey Software has no input into the content of this post or my blog- in short – this is all me… I just happen to enjoy PowerShell and automation.
Written on April 18, 2018