Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

PowerShell DSC

Direct answer

PowerShell DSC (Desired State Configuration) declares how a Windows or Linux node should be configured using resources in configuration scripts, compiled to MOF files and applied by the Local Configuration Manager.

When to use this

Use this when declaring Windows or Linux node configuration with PowerShell DSC.

First 30 seconds

1. PowerShell DSC: declarative configuration for Windows.

2. Configurations compile to MOF.

3. LCM applies and monitors.

4. Resources from modules.

5. DSC v3 is cross-platform and different — check version.

Operational verification

configuration script → MOF → LCM → resources → state

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Microsoft DSC 3.0 / PowerShell DSC compatibility
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMicrosoft DSC 3.0 / PowerShell DSC compatibility · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when declaring Windows or Linux node configuration with PowerShell DSC.
What next?3 suggested next steps
Child topics (this level)10
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Target-state verification ladder Verify boundary

PowerShell DSC uses a strict target-state ladder for DSC desired state and resource Test/Set/Get: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.

Step 2 Verification path Verify boundary

Verify the exact DSC version and resource types first, then validate/resolve the configuration document. Run dsc config get to capture current resource state and dsc config test to determine whether it matches desired state. On a controlled target, perform a set only after reviewing the intended differences, then repeat get/test and independently query the underlying OS/application setting that matters to the consumer. Test a deliberately non-converged property and confirm test reports it, and test an invalid resource/input to understand error reporting. Where a resource wraps PowerShell or external tools, capture that resource-specific boundary. A successful dsc config set is intermediate evidence until test/read-back demonstrates the required state.

Step 3 Where it fails Narrow the fault

Separate configuration parsing/schema resolution, DSC engine orchestration, resource discovery/version, resource get/test/set implementation, underlying OS/application API and final consumer-visible state. A configuration can be valid while a resource is missing; a resource can report in-desired-state using incomplete detection; set can succeed while an asynchronous service later fails. Conflicting controllers may cause repeated drift. Do not repeatedly call set until you know why test/get disagree, and do not rewrite desired state merely to match an unexplained target change. Preserve resource-level results and underlying state before remediation. After correction, repeat test/get and the independent service/OS read-back.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Desired State Configuration

Desired State Configuration is PowerShell's declarative configuration platform: you describe how a node should look, and the Local Configuration Manager makes it so and keeps checking.

Subtopic Configuration

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

Subtopic Resources

DSC resources are the building blocks that manage specific things, such as File, Service, WindowsFeature or community resources, each implementing Get, Test and Set.

Subtopic Nodes

DSC nodes are the target machines a configuration applies to, listed in the configuration's Node block or in configuration data, each getting its own MOF.

Subtopic MOF

MOF files are the compiled output of a DSC configuration, one per node, containing the resolved resource settings the LCM applies.

Subtopic Local Configuration Manager

The Local Configuration Manager (LCM) is the DSC engine on each node that applies configurations, runs consistency checks and controls refresh mode, frequency and reboot behaviour.

Subtopic Push Mode

In DSC push mode, the configuration is sent to nodes with Start-DscConfiguration.

Subtopic Pull Mode

In DSC pull mode, nodes periodically fetch their configuration and resource modules from a pull server or Azure Automation State Configuration, which scales to many nodes.

Subtopic Drift

Drift in DSC is when a node no longer matches its configuration.

Subtopic DSC Troubleshooting

Troubleshoot DSC with Test-DscConfiguration -Detailed, Get-DscConfigurationStatus, the Microsoft-Windows-DSC Operational event log, resource module versions on the node and LCM settings.

Key points
  • Configurations compile to one MOF per node.
  • The LCM applies and checks configuration.
  • ApplyAndAutoCorrect reverts drift.
Key checks
  • Get-DscResource — available resources
  • Get-DscConfigurationStatus -All — history
  • Test-DscConfiguration -Detailed — compliance
ReferenceWhy it matters1 section · depth on demand

In depth

PowerShell Desired State Configuration (DSC) is a declarative configuration platform for Windows (and partly Linux): configurations describe resources and their desired properties, and the Local Configuration Manager applies and monitors them.

VersionNote
DSC 1.1 (Windows PowerShell 5.1)Built into Windows; LCM push/pull
DSC 2 (PSDesiredStateConfiguration module)For PowerShell 7, used by Azure Machine Configuration
DSC 3Standalone dsc command, cross-platform, JSON/YAML documents

Many organisations now use DSC resources through Azure Machine Configuration or Ansible (ansible.windows.win_dsc) rather than running their own pull server.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

Microsoft Desired State Configuration (DSC) is a declarative configuration platform: configuration documents describe desired state and DSC resources implement get/test/set-style operations that inspect and enforce resource state. DSC 3.0 is a standalone cross-platform command-line application and can integrate resources authored in multiple languages; PowerShell DSC resources remain part of the compatibility/ecosystem story. The key boundary is resource ownership: the DSC engine orchestrates resource invocations, but each resource owns how actual state is discovered, compared and changed. A valid document does not show a resource is idempotent or that two resources do not conflict over the same underlying setting. Resource type/schema/version and input values therefore form part of the runtime identity.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Keep configuration documents and resource/module dependencies versioned together, including schemas and any resource discovery/install prerequisites. Treat resource versions as behavior dependencies and test upgrades before broad rollout. Define which settings DSC owns so manual tools or other controllers do not continuously fight reconciliation. Secrets should be referenced through an appropriate secure mechanism rather than embedded in plain configuration documents/logs. Use get/test before set in validation flows and schedule convergence according to risk rather than continuously mutating every host. For legacy PowerShell DSC environments, document LCM/pull-server differences separately from DSC 3.0 CLI behavior. Recovery must be able to reconstruct desired configuration from source rather than from an unknown machine state.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docMicrosoft DSC 3.0 / PowerShell DSC compatibility DSC 3.0/current

Authoritative/upstream documentation reviewed for bounded claims in > PowerShell DSC. 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%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Embedded reference data

Quick lookup tables

→ PowerShell DSC · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for → PowerShell DSC.

LayerPowerShell DSC operational reference
Runtime/ownershipMicrosoft DSC 3.0 / PowerShell DSC compatibility · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationdsc config get --file ./config.dsc.yaml; dsc config test --file ./config.dsc.yaml
Expected interpretationThe configuration document resolves the intended resources, test reports whether actual state matches desired state, and post-set read-back confirms convergence without assuming the CLI exit alone proves it.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Prefer DSC structured output over copied human console formatting. Retain configuration document identity/revision, DSC version, resource type/name, operation (get/test/set), per-resource result, changed/in-desired-state indication, error details and underlying target identifiers. For multi-resource documents, one overall exit code can hide which resource diverged, so preserve item-level results. Keep resource stderr/diagnostics separate from declarative state output when wrappers invoke external commands. Redact secrets/protected values while retaining safe property names and hashes where useful. Correlate a set operation with subsequent test/get and external target verification so the audit trail shows convergence rather than only command completion.

Confirmation

Confirm action

Continue?