Author Posts

April 26, 2018 at 3:30 pm

I am new to DSC, and I am trying to install our product on server using DSC.
The installation has 2 phases, between the phases should be reboot.
I succeeded to do it, but it looks like the second phase start before all the services are up, the process can't reach a sheared directory in the computer in a UNC.

is there solution to that, or should i configure the ALM with :
ActionAfterReboot = 'StopConfiguration'
RebootNodeIfNeeded = $true
ConfigurationMode = 'ApplyAndMonitor'
ConfigurationModeFrequencyMins = '15'

and wait 15 minutes after the reboot ?

Thanks a lot,

April 26, 2018 at 6:05 pm

If you are building a custom resource, during Set you will need to include setting the following global variable. This will signal to LCM that it should manage a reboot.
$global:DSCMachineStatus = 1

If you are only building a configuration and the existing resources meet your needs, you might need to use the xPendingReboot resource to detect that a reboot is needed. That resources is designed specifically to look for signs that Windows Server needs a reboot and then sets the global variable to make LCM aware.

Also you need to set ActionAfterReboot to ContinueConfiguration if you want DSC to continue on after the reboot has finished.


April 29, 2018 at 6:04 am

Hi Michael,
Thanks for the quick response.

what i am trying to do, is to install our product on machine.
the product is installation include to executable files. the second one should run after reboot.
i tried to use the Package and the WindowsProcess modules to install it but with out any success.
so i am installing it with script module. and between of them i use another script module that run the $global:DSCMachineStatus = 1
i configured the ALM with : ActionAfterReboot = 'ContinueConfiguration' & RebootNodeIfNeeded = $true
the reboot indeed happen between the installation, but the second on happens before the system operation actually read, the shared folder are not accessible yet and the second installation fails.

how can i tell the DSC to wait for the system to be ready before continue the configuration after the reboot ?

Thanks a lot,

May 13, 2018 at 1:47 pm

Any updates about my question ?

May 14, 2018 at 4:12 pm

This is a scenario often referred to as "waitfor". There are DSC resources "WaitForAll, WaitForAny, WaitForSome" that can be used to communicate across two machines using DSC. There are also implementations like xWaitForADDomain that look for external things to happen. That sounds like your scenario? You would want to run a loop during Set that holds progress until the share is available, with controls around how long to wait between checks and how many checks to do before timing out.


May 15, 2018 at 1:08 pm

Hi Michael,
Thanks again.

I am familiar with the DSC resource WaitForAll, i tried it.
But my problem is on a single machine. I dont need to wait for other scenarios on different machines to happen. but in the same machine. the UNC path is an actually path on the machine that i am installing the second phase of the installation after reboot.
from my experience, i tried WaitForAll to the reboot to happen, and then also gave sleep for more than few minuts, and just then configure the second phase of the installation. and after all that it's looks like it start before the UNC path on that machine was ready.
i don't know why the second phase of the installation use UNC path, for a path in the same computer, but this is what i got...:(
if there is any solution for waiting for all the system operation to load and just them continue with the configuration, i will be happy to hear.


May 18, 2018 at 2:25 pm

You need a custom resource that is a WaitFor loop looking at the local UNC path during Set. The xADDomain resource linked above has a good example. Instead of checking for the domain to exist, try using something like Resolve-Path -Path '\\localhost\c$'.