Author Posts

March 16, 2018 at 7:34 am

Hi all,

For some use cases, our DSC deployments depend on non-DSC resources (an open TCP port on a remote machine, a version of a remote service etc.).

I wonder if writing a DSC custom resource that just has payload in the Get and Test functions (and an empty Set function) is a good idea or an heresy ? The DSC configuration would fail fast and not deploy anything if prerequisites are not compliants.

Are you aware of such resources in the wild ?

March 16, 2018 at 12:37 pm

Here's a good working example. The Test just returns an immediate true/false regarding the state of the remote thing (in this case AD) and Set manages how long to wait for it to be in the required state and logging. That way you can run test-dscconfiguration without waiting on a timer.

https://github.com/PowerShell/xActiveDirectory/blob/dev/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1#L78

March 16, 2018 at 1:07 pm

Nice example, thank you !