PowerShell Genie

Learn DSC 3 without confusing it with old PowerShell DSC

Guide 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Modern Microsoft DSC is a standalone declarative configuration platform. Use it to describe desired state, invoke resources and integrate existing PowerShell DSC resources through adapters.

Overview

DSC 3

Declare desired state

Describe what should be true rather than writing a sequence of imperative repair commands.

Use resources

Resources know how to get, test and set state for a component.

Stay idempotent

Applying the same desired state repeatedly should converge rather than create duplicate changes.

Configuration document shape

1PS> $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
2PS> resources:
3PS> - name: example
4PS> type: Microsoft.Windows/Registry
5PS> properties:
6PS> # resource-specific desired state

Resource types and properties depend on what is installed. Discover resources before authoring a real configuration.

DECLARATIVE THINKING

Describe the state, then test whether reality matches it

DSC practice is less about a one-off command and more about repeatable state. Focus on resources, idempotency, test results and the boundary between configuration data and execution.

Think in resources

Define what should exist and which properties matter. A good resource can test current state, apply only necessary changes and report a consistent result.

Prove repeatability

Run the same configuration logic again and verify that an already-correct system does not keep changing. That idempotent behavior is central to reliable configuration management.

Continue
Genie guideLearn DSC 3 without confusing it with old PowerShell DSC

Modern Microsoft DSC is a standalone declarative configuration platform. Use it to describe desired state, invoke resources and integrate existing PowerShell DSC resources through adapters.