In this section we describe the current state of the guidelines and best practices to create a High Quality Resource Module.

See the following sections for more details, and if you need more guidance join the conversation and ask away!

Markdown Files

Line length not longer than 80 characters

Rows longer than 80 characters should be split into …

Read guidelines

General

Correct File Encoding

Make sure all files are encoded using UTF-8 (not UTF-8 with BOM), except mof …

Read guidelines

Whitespace

Indentation

For all indentation, use 4 spaces instead of tabs. There should be no tab characters in …

Read guidelines

Functions

Function Names Use Pascal Case

Function names must use PascalCase. This means that each …

Read guidelines

Parameters

Correct Format for Parameter Block

  • An empty parameter block should be displayed on its own line …

Read guidelines

Variables

Variable Names Use Camel Case

Variable names should use camelCase.

Bad:

function Write-Log
{ …

Read guidelines

General Best Practices

Although adopting the best practices is optional, doing so will help improve the quality of the DSC …

Read guidelines

Calling Functions

Avoid Cmdlet Aliases

When calling a function use the full command not an alias. You can get the full …

Read guidelines

Writing Functions

Avoid Default Values for Mandatory Parameters

Default values for mandatory parameters will always be …

Read guidelines

Dsc Resource Functions

Return a Hashtable from Get-TargetResource

Bad:

Good:

Return a Boolean from Test-TargetResource

Bad: …

Read guidelines

Manifest

Avoid Using Deprecated Manifest Fields

Bad:

Good:

Ensure Manifest Contains Correct Fields

Bad:

Good: …

Read guidelines

Localization

In each resource folder there should be at least one localization folder for english language …

Read guidelines

Pester Tests

Capitalized Pester Assertions

Pester assertions should all start with capital letters. This makes …

Read guidelines