New Puppet facts for Windows

See more posts about: Windows

To manage your Windows desktops and servers based on the version / edition of Windows installed across your organisation, we’ve introduced Windows build-specific facts to Puppet.

If you have a mix of Windows servers (Core and ServerStandard) and Windows desktops with varying versions and editions Windows, using Windows build-specific facts allows you to:

  • Avoid installing GUI type tools (Notepad++) on Windows core servers
  • Ensure that new features (e.g. Windows Terminal) are only installed on versions of Windows that support them
  • Install VS Code with Puppet extensions on client desktops only

Let’s see what all this looks like in some Puppet code:

  if $facts['os']['windows']['release_id'] >= '1904' {
    # Ensure Build Version Supports Windows Terminal
    package { 'microsoft-windows-terminal':
      ensure   =>  installed,
      provider => 'chocolatey',

  if $facts['os']['windows']['installation_type'] != 'Server Core' {
    # Editors not permitted on Core Servers
    package { 'notepadplusplus':
      ensure   =>  installed,
      provider => 'chocolatey',

  if $facts['os']['windows']['installation_type'] == 'Client' {
    # VS Code to be installed on Desktops with Puppet Extensions
    package { 'vscode':
      ensure   =>  installed,
      provider => 'chocolatey',
    package { 'vscode-puppet':
      ensure   =>  installed,
      provider => 'chocolatey',

What are the new facts and what do they do

The previous example uses a number of new facts which were added recently to Facter under the key:

C:> facter
  edition_id => "Professional",
  installation_type => "Client",
  product_name => "Windows 10 Pro",
  release_id => "2004",
  system32 => "C:\WINDOWS\system32"

All of these facts are derived from the Windows Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion as shown in the following table.

Registry ValueFactDescriptionSyntax/Example
ReleaseIDrelease_idThe 4 digit Windows Build VersionYYMM (e.g. 1904)
InstallationTypeinstallation_typeDifferentiates Server, Server Core, and Client (Desktop)Server
EditionIDedition_idServer or Desktop Edition variantServerStandard, Professional, Enterprise
ProductNameproduct_nameTextual Product NameWindows 2019 Standard Edition

Note - release_id is returned for Windows 10/Server 2016 builds only (i.e. Windows 2012r2 doesn’t contain this registry entry).

These new facts also support:

  • Fact Collection to determine Windows 10 Build Versions (Feature releases)
  • Patching and ensuring supported versions are in use

John O’Connor is a senior engineer in developer services who has a passion for ensuring Windows remains a first-class Puppet citizen.

Learn more

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.