Test only DSC resources

This topic contains 2 replies, has 2 voices, and was last updated by  Julien Nury 2 months, 1 week ago.

  • Author
  • #96143

    Julien Nury

    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 ?

  • #96176

    Michael Greene

    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.


  • #96177

    Julien Nury

    Nice example, thank you !

You must be logged in to reply to this topic.