I´m using a lot of self written DSC Resource and sometimes these resources needs a reboot. So I added $global:DSCMachineStatus = 1 to these scripts. When the DSC Resource executes the $global:DSCMachineStatus = 1 the LCM is waiting for a reboot to continue.
Is it possible to detect that the LCM needs a reboot? Maybe query somehow the DSCMachineStatus? Setting the LCM RebootNodeIfNeeded = $true is not an option.