DEV Community

Cover image for Two Helpful Tools to Automate Your Windows Setup
Michael Lohr
Michael Lohr

Posted on • Edited on • Originally published at blog.lohr.dev

Two Helpful Tools to Automate Your Windows Setup

I like to have the same configuration & software on all my systems. I also do not want to spend hours on my setup, while resetting my machine or setting up a new one. With Linux, this has always been pretty easy: Just put your dotfiles on a git repo and clone them when you set up a new machine.

Microsoft is currently working on enhancing the development experience on Windows. They are actively working on a new terminal emulator, a window manager, a way to use Linux on your Windows machine and more.

Two years ago they started working on a collection of scripts, to get a new development machine ready with just one click. They have scripts to set up a WSL/Hyper-V, Docker/Kubernetes, NodeJS, Machine Learning, C++ desktop app or Web stack development environment. While those are great, you can also use them as inspiration to create your own collection of scripts.

We need two tools for our automated setup:

  • Chocolatey: A package manager for Windows (like apt-get for Linux), which can install most software with just a command
  • Boxstarter: A tool to automate the configuration of Windows settings and installation of Chocolatey packages.

I recommend you to copy one of the scripts from Microsoft's collection and adjust it to your needs.

You can install packages using Chocolatey like so:

  1. Fing your package on the online database
  2. Add the following to your Boxstarter script or open a Powershell terminal with admin privileges and execute: choco install <package name> -y

You can change your Windows settings by executing Boxstarter scripts like so:

  1. Have a look at the Boxstarter repository and find a script you want to use.
  2. Add the script to your Boxstarter setup script or open a Powershell terminal with admin privileges and execute it. For example: Set-TaskbarOptions -AlwaysShowIconsOn

You then can use your script to build a one-click-package by appending your public script/repo/gist to a URL, like so: http://boxstarter.org/package/url?https://raw.githubusercontent.com/GITHUB_DOMAIN/GITHUB_REPO/YOUR_BRANCH/RECIPE_NAME.ps1

Top comments (0)