PowerShell DSC and its CLI are powerful tools for declarative infrastructure management—
ensuring systems can self-heal, stay compliant, and align with architectural baselines.
⚙️ What Is PowerShell DSC?
DSC is a declarative configuration platform that defines the desired state of a system
(e.g., installed features, file contents, registry settings) and enforces it automatically.
🔑 Key Concepts
Configuration Document: Written in PowerShell or YAML/JSON, describes what the system should look like.
DSC Resources: Modules that manage components (e.g., WindowsFeature, File, Registry).
Idempotency: Running the same config multiple times yields the same result without side effects.
Compile to MOF File: Generates a .mof file describing the desired state.
Apply Configuration: Use Start-DscConfiguration to enforce the state.
🧩 PowerShell DSC Architecture Flow
🖥️ CLI Interface (DSC v3)
The newer DSC CLI (dsc) is cross-platform, built on a Rust-based engine. It supports JSON/YAML configurations
and adapter resources for PowerShell and Windows.
Example Commands:
dsc config set -f config.yaml
dsc resource list
dsc resource invoke --name File --method Set