No Datum store found for DSC Resource error

Welcome Forums DSC (Desired State Configuration) No Datum store found for DSC Resource error

Viewing 2 reply threads
  • Author
    Posts
    • #177289
      Participant
      Topics: 9
      Replies: 59
      Points: 457
      Helping Hand
      Rank: Contributor

      I watched Gael Colas’ presentations which can be found on Youtube,
      and I am very convinced that it is a very usefull module when working with DSC.
      However, I am not able to use Datum correctly.

      I’ve created a little structure with 2 nodes and 2 roles just to play arround and be able to manage the basics.

      Based on what I found on the Datum’s Github page, I’ve filled the files and here is the content

      Now creating the Datum variable

      Looking inside the variable

      So far so good!

      However, I am not able to make the lookup working…

      If someone could save me from tearing my hair out of my head… 🙂

    • #177295
      Participant
      Topics: 1
      Replies: 54
      Points: 202
      Helping Hand
      Rank: Participant

      If you change your debug preference to continue you should get much more info for troubleshooting.

       

      Sorry, only on my phone rn.

      Feel free to paste result here and I can try to help interpret.

      • #177304
        Participant
        Topics: 9
        Replies: 59
        Points: 457
        Helping Hand
        Rank: Contributor

        Hi Gael!

        Here is the output:

    • #177307
      Participant
      Topics: 1
      Replies: 54
      Points: 202
      Helping Hand
      Rank: Participant

      Ha yeah, you don’t have anything set for Node to lookup.

      You should first set it:

      $node = $datum.AllNodes.’v-computer1′

      Then do the lookup.

      The lookup command has a parameter $node that resolves automatically what exist in current session, or you can explicitly pass the node Hashtable as param.

      • #177523
        Participant
        Topics: 9
        Replies: 59
        Points: 457
        Helping Hand
        Rank: Contributor

        Unfortunately I get the same error.
        It would have suprised me because I already used the -Node parameter with the cmdlet.

        I also tried without using the -Node parameter, but same error.

      • #178344
        Participant
        Topics: 9
        Replies: 59
        Points: 457
        Helping Hand
        Rank: Contributor

        My apologies Gael,

        Despite your clear explanation, I’ve completely misread your answer…
        By using the $Node object instead of the node name it’s working better 🙂

        I had a look at your code and have a suggestion to avoid this mistake with other people using your module:

        You can create the $root object in the New-DatumStructure function with a PSTypeName.
        And accordingly, you can check this PSTypeName on the -Node parameter from the Resolve-Datum (lookup) function
        instead of validating the parameter as a beeing a string.

        I am quite sure you know the PSTypeName, but just in case, here is very good explanation from Adam Bertram:

        https://adamtheautomator.com/building-custom-object-types-powershell-pstypename/

        Anyway, thanks for your help Gael! 🙂

Viewing 2 reply threads
  • The topic ‘No Datum store found for DSC Resource error’ is closed to new replies.