A helper for writing tasks in PowerShell




3,990 latest version

4.1 quality score

Version information

  • 0.1.0 (latest)
released Feb 24th 2021

Start using this module


puppetlabs/powershell_task_helper — version 0.1.0 Feb 24th 2021


A helper library for Puppet Tasks written in PowerShell.

Table of Contents

  1. Description
  2. Setup - The basics of getting started with powershell_task_helper
  3. Usage - Configuration options and additional functionality
  4. Development - Guide for contributing to the module


A PowerShell helper library for use by Puppet Tasks. It provides a function that handles error generation, simplifies JSON input and output, and makes testing your task easier. It requires Bolt >= 2.4.


Beginning with powershell_task_helper

To use this library, include this module in a Puppetfile:

mod 'puppetlabs-powershell_task_helper'

Add the helper file to your task metadata:

  "files": ["powershell_task_helper/files/BoltPwshHelper/"],
  "input_method": "powershell"


Bolt automatically adds your task directory to the $env:PSModulePath, so PowerShell module auto loading will work without having to write out the Import-Module statement. If your target is using PowerShell 3.0, you will have to add an import statement.

For a complete example of using the helper file in a task, see the examples.


Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

For more information, see the CONTRIBUTING.md documentation in this module.