Chef on a Windows Workstation

Setting up an admin workstation for Chef on Windows might be a little daunting for people starting out on Chef and for those who are not comfortable with the command line. This snippet is a useful little batch file we use at work.

First, install the Omnibus Installer for Chef-Client then create a batch file with this script:

@echo off

set PATH=C:\opscode\chef\embedded\bin;C:\opscode\chef\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;

cmd

This creates a command prompt with a clean PATH that only contains knife, gem and other goodies.

Another heads up: When doing knife configure -i for the first time on Windows, you’ll be asked for file paths on your admin.pem and other stuff. Use double back-slashes instead of a normal slash