Get-DscResource with Composite Resources

This topic contains 4 replies, has 3 voices, and was last updated by  Rob Pleau 1 year, 2 months ago.

  • Author
    Posts
  • #53602

    Rob Pleau
    Participant

    Hello, I am wondering if anyone can take a look and maybe point out what I could be doing wrong here. I am trying to break up a big configuration into smaller composites. For the time being I was going to include all the composite resources in a single resource module. It seems to let me use the composites when I create a new configuration and reference the composites but whats strange is I never can see them listed as 'Composite' when doing a Get-DscResource.

    I have some example code here which has the same issue as my real configurations, the example code configurations are just populated with dummy text for the most part so anything within the here strings to create the schema files might seem wacky.

    Can anyone see anything glaringly wrong?

    • This topic was modified 1 year, 2 months ago by  Rob Pleau.
  • #53615

    Bob Dean
    Participant

    Viewing this quickly from my phone, but I'm certain that your composite resources need to be placed in a folder called DSCResources.

    In your case TestModule\DscResouces\CompositeResource...

    • #53619

      Rob Pleau
      Participant

      Good catch thanks, I updated the gist! I definitely missed that directory when creating my test example. I still don't seem to be able to see the composite resources missing having added that though so i'm still stumped. One additional note. I know it was likely unrelated but I did this on both WMF5 and WMF5.1 preview with same results, the composites not listed.

  • #53734

    Don Jones
    Keymaster

    To confirm – are you able to -use- but not -see- the resource?

    • #53749

      Rob Pleau
      Participant

      From the looks of it yes, I can create a configuration after doing Import-DSCResource and specifying the composite resource or resource module and then get intellisense if I reference it. I know it seems picky I wasn't sure if I was just doing something wrong in my top level module manifest.

You must be logged in to reply to this topic.