Running Puppet commands on Windows

Puppet was originally designed to run on *nix systems, so its commands generally act the way *nix admins expect. Because Windows systems work differently, there are a few extra things to keep in mind when using Puppet commands.

Supported commands

Not all Puppet commands work on Windows. Notably, Windows nodes can’t run the Puppet Server or puppetserver ca commands.

The following commands are designed for use on Windows:

Running Puppet's commands

The installer adds Puppet commands to the PATH. After installing, you can run them from any command prompt (cmd.exe) or PowerShell prompt.

Open a new command prompt after installing. Any processes that were already running before you ran the installer do not pick up the changed PATH value.

Running with administrator privileges

You usually want to run Puppet’s commands with administrator privileges.

Puppet has two privilege modes:

  • Run with limited privileges, only manage certain resource types, and use a user-specific confdir and codedir

  • Run with administrator privileges, manage the whole system, and use the system confdirand codedir

On *nix systems, Puppet defaults to running with limited privileges, when not run by root, but can have its privileges raised with the standard sudo command.

Windows systems don’t use sudo, so escalating privileges works differently.

Newer versions of Windows manage security with User Account Control (UAC), which was added in Windows 2008 and Windows Vista. With UAC, most programs run by administrators still have limited privileges. To get administrator privileges, the process has to request those privileges when it starts.

To run Puppet's commands in adminstrator mode, you must first start a Powershell command prompt with administrator privileges.

Right-click the Start (or apps screen tile) -> Run as administrator:

Click Yes to allow the command prompt to run with elevated privileges:

The title bar on the comand prompt window begins with Administrator. This means Puppet commands that run from that window can manage the whole system.