Use this when writing a DSC configuration block.
Configuration
A DSC configuration is a PowerShell block that declares resources and their desired properties for nodes, compiled into one MOF file per node.
1. A configuration is a PowerShell block declaring resources per node.
2. Separate configuration data.
3. Use composite resources for reuse.
4. Credentials need encryption (certificates).
5. Version control.
configuration + data → compile → MOF per node
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-DscConfigurationPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Command read-back and what it shows Verify boundary
Verification for PowerShell DSC → Configuration must distinguish state, not merely report that a command ran. With Get-DscConfiguration, known-good means the intended node receives a compiled configuration containing the expected resource instances/properties and a subsequent DSC consistency check evaluates that same configuration without schema or targeting mismatch; known-broken/suspicious means compile/schema errors, wrong node identity, missing/old MOF, unexpected resource properties or a correct document that the node cannot evaluate. Get-DscConfiguration shows the configuration/resources currently reported by DSC on the queried node, but it does not show source configuration correctness, future convergence or application health.
Step 2 Observation-driven branch and next-check logic Narrow the fault
When PowerShell DSC → Configuration fails, reproduce the smallest original case and capture Get-DscConfiguration before mutation. Use the observation to choose the next check: if compilation fails, inspect resource schema/module/version and configuration data; if compilation succeeds but node document is missing/wrong, inspect node naming/output path; if correct MOF exists but convergence fails, move to LCM/resource execution and node-side state.
Step 3 Common mistakes Narrow the fault
- Configurations with credentials in plain text.
- A configuration declares resources per node.
- It compiles to one MOF per node.
- Configuration data separates values from structure.
Configuration WebServer { … }; WebServer -OutputPath .\mof— compile- Configuration data (.psd1) separate from logic — parameters
- Configurations in git — versioning
ReferenceWhy it matters1 section · depth on demand
In depth
A DSC configuration is a PowerShell block (Configuration keyword) that, when run, compiles into a MOF document per node. The MOF is what the Local Configuration Manager actually applies.
| Part | Purpose |
|---|---|
Configuration Name { } | Defines the configuration |
Import-DscResource | Brings in resource modules |
Node block | Target machine(s) |
| Resource blocks | Desired settings |
Configuration data (-ConfigurationData) | Separates per-node data from structure |
$data = @{ AllNodes = @( @{ NodeName = 'web01'; Role = 'Web' }, @{ NodeName = 'web02'; Role = 'Web' } ) }
WebServer -ConfigurationData $data -OutputPath C:\DSC\Web
Never put plain-text credentials in configuration data; use certificates to encrypt them in the MOF.
ReferenceHow it works1 section · depth on demand
How it works
PowerShell DSC → Configuration should be reasoned about as a state pipeline, not as one command outcome. The responsible state is the DSC configuration document, compiled MOF identity, node targeting and resources/properties that define desired state for one managed node. A DSC configuration is authored as PowerShell and compiled into node-specific MOF documents; resource schema and configuration data determine the properties the Local Configuration Manager will later evaluate; meanwhile module/resource versions, certificates for protected credentials, configuration data, pull-server availability and node registration are separate things to check. This distinction is especially important because successful compilation shows document/schema consistency only, not that the intended node received the correct MOF or can converge it.
ReferenceImportant terms & boundaries2 sections · depth on demand
Known-good, transitional and broken reference
Configuration — comparative operational reference for PowerShell DSC → Configuration. What it does not show: request acceptance or job success does not show target change, effective state or workload recovery Next check: move one step toward the original workload using Inspect $Error/exception/exit semantics and the returned object, then query the target independently and verify the service/application outcome rather than treating command completion as evidence. Platform/scope: PowerShell 5.1/7+, module versions and remoting endpoint behavior vary by host/platform.
Mechanics
The linked authority for bounded mechanics is Microsoft Learn — Desired State Configuration overview; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in PowerShell DSC > Configuration. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/dsc/overview?view=dsc-3.0 · confidence 94%