Simplify software installation with Chocolatey

Working in the virtualization field demands a skill set which crosses domains.  Windows guest administration is one of the tasks that can’t be ignored. Be it template management, deployment, or performance troubleshooting, Windows administration is a basic skill that a well-rounded administrator should be able to do.  However, Windows administration can be a full time job, so if one’s focus is one level up, on the hypervisor, it’s important to have a consistent set of easily accessible tools to do basic administrative tasks.  A colleague pointed me to Chocolatey as a meta-tool which can help install and manage best-of-breed tools which often aren’t developed by Microsoft or included with the standard operating system install.

https://github.com/chocolatey/chocolatey/wiki

Chocolatey is a global PowerShell execution engine using the NuGet packaging infrastructure. Think of it as the ultimate automation tool for Windows.

Chocolatey is like apt-get, but built with Windows in mind (there are differences and limitations). For those unfamiliar with apt/debian, think about chocolatey as a global silent installer for applications and tools. It can also do configuration tasks and anything that you can do with PowerShell. The power you hold with a tool like chocolatey is only limited by your imagination!

You can develop your tools and applications with NuGet, and release them with chocolatey!
But chocolatey is not just for .NET tools. It’s for nearly any windows application/tool!

So what does this mean in theory?  Chocolatey is a Powershell automation tool which can help automate the installation of software packages, including dependency management.  What does this mean in practice?  With a command, you can download and install important software to your Windows workload.  The most complex command is the installation of Chocolatey itself.  From the shell (cmd.exe) run with administrative privileges:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

You can browse the list of software that’s been packaged in the Chocolatey Gallery.  Most of the standard free utilities that you might already be using are available.  Once you decide you want a package, you just issue the installation command, again from the Command Shell.  Want to install Google’s Chrome browser?

cinst GoogleChrome

Perhaps you prefer Firefox?

cinst Firefox

See how easy this could be?  Perhaps you generally install 7zip, WinDirStat, and PuTTy on a machine.  Instead of carrying them around, going stale on a USB drive, you could:

cinst putty
cinst windirstat
cinst 7zip

Clean and simple, right?  So what uses can you think of?

image sources

Published by

JohnWhite

John White is walking the path to virtualization mastery.

One thought on “Simplify software installation with Chocolatey”

Leave a Reply