Distributing arbitrary DSC resources

You can use the puppetlabs-dsc_lite module to manage target nodes with arbitrary DSC resources.

CAUTION: The puppetlabs-dsc_lite requires previous experience with DSC and PowerShell. It is an alternative approach to Puppet's other DSC modules, providing more flexibility for advanced users.

The puppetlabs-dsc_lite module contains a lightweight dsc type — a streamlined and minimal representation of a DSC Resource declaration in Puppet syntax. While it does not contain any DSC resource, it knows how to invoke ones that already exists on the managed node.

You can use a DSC Resource by supplying the same properties you would set in a DSC configuration script — inside the properties parameter. For most use cases, the properties parameter accepts the same structure as the PowerShell syntax, with the substitution of Puppet syntax for arrays, hashes, and other data structures.

You can use the following PowerShell command to identify the available parameters:
PS> Get-DscResource WindowsFeature | Select-Object -ExpandProperty Properties

Using the puppetlabs-dsc_lite module, you can specify a version of the DSC Resource to use for each resource declaration. For example, you might want to specify a version if your target node has multiple versions installed, or if you need to use multiple versions in a single Puppet run.

To specify a version of a DSC Resource, you can use a similar syntax to a DSC configuration script — using a hash containing the name and version of the DSC Resource module. For example:
dsc {'iis_server':
  resource_name => 'WindowsFeature',
  module        => {
    name    => 'PSDesiredStateConfiguration',
    version => '1.1'
  },
  properties => {
    ensure => 'present',
    name   => 'Web-Server',
  }
}

For more information, see the the puppetlabs-dsc_lite module's documentation.