Automation · PowerShell DSC
Desired State Configuration
Cheat sheet · https://pcornel.dk/topic.php?topic=5676
Answer
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.
Remember
- DSC declares node configuration.
- The LCM applies it and checks it.
- Push or pull delivers it.
First checks
Get-DscLocalConfigurationManager | fl ConfigurationMode,RefreshMode— LCM modeTest-DscConfiguration— compliant?Get-DscConfiguration— current state
Commands
Test-DscConfiguration -Detailed- Read-only/validation observation for resource-by-resource DSC compliance result for the selected node.
Verify in this order
desired state → LCM → test/set resources
Where it usually breaks
Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5676