Best Practices

In order to write PowerShell DSC Configurations, you need some tools to get you started.

WMF 5.1

If it is not already installed, you should install the Windows Management Framework 5.1.

If you are running Windows 10 or Windows Server 2016 and above, it should already be installed.

PowerShell Get

Run the following commands as administrator on your Windows machine:

Install-Module -Name PowerShellGet -Force

More information on PowerShell Get.

Code Editors

You will need a suitable source code editor, so we recommend one of the following.

Visual Studio Code

Visual Studio Code is our preferred code editor for all PowerShell related topics. It can be downloaded here. You can install it for a user or as system installer. Choose the installer that fits your needs.

IntelliJ IDEA

If you are not a fan of Visual Studio Code you can alternatively use IntelliJ IDEA. It can be downloaded here.

PowerShell ISE

PowerShell ISE is another code editor you can use to edit your DSC configurations, but we strongly recommend one of the two above.

Install additional DSC Resources

Additional DSC Resources can be downloaded from PowerShell Gallery. The modules you need to download depend on the configuration you want to create. Browse through the PowerShell Gallery to find the resources you need.

If the resources are not there yet, feel free to write your own.

They are installed via PowerShell:

Install-Module -Name xWindowsUpdate

Naming Conventions for DSC Configurations

Follow the guidelines below to ensure the correct processing:

  • Standard names may only contain letters (a-z, A-Z), numbers (0-9), and underscore (_).

  • The name may not be null (0), empty ( ) or written with hyphen (-), and should start with a letter (a-z, A-Z).

Valid Naming Examples

“XOAP_Any_Apps_And_Monitoring”

“xoap_any_apps_and_monitoring_0_1_9”

“XOAP_Hp_Dl380_Baseline_Configuration”

“xoap_hp_dl380_baseline_configuration”

Invalid Naming Example

“XOAP-W10-20H2-Citrix-Optimizer”

“01 XOAP W10 20H2 Citrix Optimizer”