Pcornel
Automation · PowerShell DSC

Drift

Cheat sheet · https://pcornel.dk/topic.php?topic=5684

Back to the Topic

Answer

Drift in DSC is when a node no longer matches its configuration. The LCM detects it on each consistency check and either reports it (ApplyAndMonitor) or fixes it (ApplyAndAutoCorrect).

Remember

  • The LCM detects drift on each consistency check.
  • ApplyAndMonitor reports drift.
  • ApplyAndAutoCorrect fixes it.

First checks

  • Test-DscConfiguration -Detailed | select -Expand ResourcesNotInDesiredState — drifted resources
  • ApplyAndAutoCorrect mode — auto-fix
  • Drift alerts — monitoring

Verify in this order

desired vs actual → drift → correct/alert

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=5684

Confirmation

Confirm action

Continue?