Get-DscResource with Composite Resources

Welcome Forums DSC (Desired State Configuration) Get-DscResource with Composite Resources

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
2 years, 1 month ago.

  • Author
    Posts
  • #53602

    Participant
    Points: 0
    Rank: Member

    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?

  • #53615

    Participant
    Points: 0
    Rank: Member

    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

      Participant
      Points: 0
      Rank: Member

      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

    Keymaster
    Points: 7
    Rank: Member

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

    • #53749

      Participant
      Points: 0
      Rank: Member

      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.

The topic ‘Get-DscResource with Composite Resources’ is closed to new replies.