What is Chocolatey and Why Would I Use It
Chocolatey is an application repository with a commandline provider similar to apt or yum on Linux. The great thing about Chocolatey is it makes software installation scriptable. Think of setting up new workstations or servers. Depending on the environment there is a ton of software to install, things like notepad++, .Net Framework, New Relic, or if you’re setting up a dev environment maybe Visual Studio, notepad++, Adobe Reader, Java JDK, etc. Now you can automate this with a PowerShell script, or better yet if you use Puppet you can leverage the Puppet forge module for Chocolatey.
To install Chocolatey run the following in PowerShell:
That’s it now Chocolatey is installed.
To install applications in Chocolately you will find the commands listed next to the software in the Chocolatey packages library at https://chocolatey.org/packages or you can use the commandline search tool (See https://github.com/chocolatey/choco/wiki/CommandsList for examples). You can also setup your own local Chocolatey server if you are in an enterprise environment, however this is outside the scope of this article. Below is an example of several common applications being installed via Chocolatey in PowerShell
Puppet Forge Module
If your organization is already using Puppet to do config management you can use Chocolatey as a provider in Puppet. To install the module on your Puppet master run the following command:
To use the module you can create a Puppet class for you nodes refer to the usage instructions located at https://forge.puppet.com/chocolatey/chocolatey#usage