WMF 5.0 and Composite configs

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of David Jones David Jones 2 years, 2 months ago.

  • Author
    Posts
  • #18844
    Profile photo of David Jones
    David Jones
    Participant

    I setup my DSC enviroment similar to what I say Steve demonstrates here https://powershell.org/author/StevenMurawski/

    I decited to try out WMF 5.0 and found My configuration completely broken. and Invoike-DSCBuild would get stuck trying to load my config file.

    It would seem placeing the composite configs in the same folder structure as Steve had does not play nice with v5 due to the new way DSC resorces are done.

    DSC_Tooling
     \
      MyConfig
      \
    	MyConfig.psd1
    	MyConfig.psm1
    	DSCResources
    	\
    	 BaseServer
    	 FileServer
    	 

    When invoke-DSCbuild loads MyConfig, the command Import-DSCResorces -ModuleName MyConfig will cause an infinate loop loading the same same file over and over. In V4 it ignored the moduel file and just loaded the content of DSCResorce

    I'm now in the process of seporating the MasterConfig from the composite parts more like the way the DSCbook works so I can get this to build on both V5 and V4.

  • #18907
    Profile photo of Don Jones
    Don Jones
    Keymaster

    v5 definitely has some changes, and we don't yet know if the current preview is the extent of those changes, or if there will be more by final release. You might want to wait a bit for final release before doing a lot of work on this.

  • #18913
    Profile photo of David Jones
    David Jones
    Participant

    It only takes a few minutes to make the changes. I move the folders from myConfig/DSCResorce to the root of in DSC_Tools and add a few more entries to Import-DscResource.

    I did try a rename to make composite config fragments easier to find and discovered that there is a limit on the length of a module name. over 15 chars and it would fail to import. I don't know if this is a bug in the preview or if that was already that way in v4.

    I will find out once I switch back to v4 latter this week.

You must be logged in to reply to this topic.