Automation · PowerShell DSC
DSC Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=5685
Answer
Troubleshoot DSC with Test-DscConfiguration -Detailed, Get-DscConfigurationStatus, the Microsoft-Windows-DSC Operational event log, resource module versions on the node and LCM settings.
Remember
- Test-DscConfiguration -Detailed.
- DSC Operational log.
- Resource versions on nodes.
First checks
Get-WinEvent -LogName 'Microsoft-Windows-DSC/Operational' -MaxEvents 30— DSC eventsGet-DscConfigurationStatus | fl *— errorsRemove-DscConfigurationDocument -Stage Pending— clear stuck pending
Commands
Get-DscConfigurationStatus -All- Read-only/validation observation for DSC consistency/configuration run status, type, start/end time and error context.
Verify in this order
configuration → LCM → resource → error
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=5685