Book Image

Learning PowerShell DSC

By : James Pogran
Book Image

Learning PowerShell DSC

By: James Pogran

Overview of this book

Table of Contents (14 chapters)
Learning PowerShell DSC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a custom PowerShell v4 DSC Resource


We have touched on how to create PowerShell c4 DSC Resources briefly as we have worked our way through this book, and here, we will dive into the details of doing so in depth. We will cover the folder structures and files needed as well as the mindset and best practices necessary in order to make custom DSC Resources that are effective and useful to you.

Note

Before continuing, ensure that you are familiar with creating PowerShell v2 modules. Knowing how to create and use PowerShell modules is the key in understanding how DSC Resources are made.

The folder structure of a v4 DSC Resource

A v4 DSC Resource has a strict folder structure. By convention, each PowerShell module that contains one or more DSC Resources is stored in the $env:ProgramFiles\WindowsPowerShell\Modules folder. You can store DSC Resources in any of the standard $env:PSModulePath paths, or you can store them in a location of your choosing, so long as you append the location to the...