Pcornel
Automation · PowerShell DSC

Configuration

Cheat sheet · https://pcornel.dk/topic.php?topic=5677

Back to the Topic

Answer

A DSC configuration is a PowerShell block that declares resources and their desired properties for nodes, compiled into one MOF file per node.

Remember

  • A configuration declares resources per node.
  • It compiles to one MOF per node.
  • Configuration data separates values from structure.

First checks

  • Configuration WebServer { … }; WebServer -OutputPath .\mof — compile
  • Configuration data (.psd1) separate from logic — parameters
  • Configurations in git — versioning

Commands

Get-DscConfiguration
Read-only/validation observation for current values reported by DSC resources on the target node.

Verify in this order

configuration + data → compile → MOF per node

Where it usually breaks

Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5677

Confirmation

Confirm action

Continue?