Passing variable between DSC resources at runtime

This topic contains 3 replies, has 4 voices, and was last updated by Profile photo of Andrew Pearce Andrew Pearce 3 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38739
    Profile photo of Ramon Palmieri
    Ramon Palmieri
    Participant

    Hi,

    I wrote a Script resource which will request a certificate from a CA.
    Now I want to use the CertificateThumbprint in a subsequent DSC resource (xdsdcwebservice to be precise).
    The problem is, I do not know the thumbprint when I create the mof, obviously, because it does not exist yet.

    Is there a way to pass parameters between DSC resources at run time?

    Any help appreciated.

    Ramon.

    #38740
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Unfortunately, no. This sort of enhancement is pretty much at the top of many DSC wish-lists. 🙂

    #38783
    Profile photo of Nitin Gupta
    Nitin Gupta
    Participant

    If there isn't already, can you file this idea on uservoice for this request @ https://windowsserver.uservoice.com/forums/301869-powershell.

    #41350
    Profile photo of Andrew Pearce
    Andrew Pearce
    Participant

    If you modify the second resource you could write the cert out to disk or registry and read it back in the follow up resource. Even encrypt it or change perms to local system only if you want it slightly more secured.

    Unfortunately due to how CIM is implemented the runspace is reset between invocations so even a globally scoped variable won't be accessible.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.