hckr.fyi // thoughts

Boxstarter for Automation and Development Machine Recovery

by Michael Szul on

Getting a new computer, laptop, or tablet is awesome. You know what's not awesome? Having to install all the software on the new device that you used to use on your old device. It isn't unheard of to spend an entire day (or two) installing software, and configuring Windows (or Mac or Linux) just to get up and running.

Allow me to present for your enjoyment: Boxstarter. Boxstarter is a Powershell application that uses the Chocolatey package manager to install not just all of the software that you want, but reboot your computer when the installation process calls for it, and even modify your environment to suit your needs. Boxstarter can enable windows features, modify preferences, pin shortcuts to taskbars, and even spin up virtual machines within the cloud. It can cut a day long process into a process that only takes a few hours, and if you use the easiest "installation" process, you only need a small script and a URL to kick off the process on a fresh box.

For example, at some point over the next few months, I'll be receiving a new work machine, and I wanted to use Boxstarter to set it up. In order to test out my script, I spun up a few Azure virtual machines one weekend, and tested out a few variations, slowly adding programs and components. Since your Boxstarter script is a Powershell script, in addition to modifying system items, you can run other commands, such as npm after you've installed node.js.

Here is a copy of my Boxstarter script that is hosted on GitHub's Gist (a few items are commented out):

With this script up on Gist, all I have to do is get the URL for the "raw" output, and pass that to the Boxstarter url:

http://boxstarter.org/package/url?https://gist.githubusercontent.com/szul/03e4509484c7bf8ce9fb/raw/39aa3664eee11f523877df8216e12333a64e3472/Boxstarter.ps1
    

Hitting this URL in a browser will start the web launcher at Boxstarter, install Boxstarter, install Chocolatey, and then start to install the software and components in the script.

It's that easy.