How do I compile DSC to MOF if required module is not yet available

Welcome Forums DSC (Desired State Configuration) How do I compile DSC to MOF if required module is not yet available

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

1 year, 10 months ago.

  • Author
  • #69825

    Points: 12
    Rank: Member

    I need to use module xWebAdministration in my DSC Configuration but this module is not yet installed in system and being installed in Configuration preceding current one. Example is below.

    Configuration BasicIIS
        Import-DscResource -ModuleName 'PSDesiredStateConfiguration' 
        node localhost {
                  ... Script etc logic which installed xWebAdministrationModule
    BasicIIS -OutputPath .\BasicIIS
    Start-DscConfiguration -Wait -Verbose -Path .\BasicIIS -Force
    Configuration SecondStep
        Import-DSCResource -moduleName "xWebAdministration"
        xWebSiteDefaults DefaultConfig {
            ApplyTo = "Machine"
            LogDirectory = "c:\inetpub\logs\LogFiles\host"
            TraceLogDirectory = "c:\inetpub\logs\LogFiles\host\FREB"
    SecondStep -OutputPath .\BasicIIS
    Start-DscConfiguration -Wait -Verbose -Path .\BasicIIS -Force
  • #69975

    Points: 45
    Rank: Member


    It depends on your setup. I wouldn't use to install your DSC Resources. If you are using the PULL model, then you would have to zip your DSC Resource Modules in a specific way and place them on the DSC Pull Server 'C:\Program Files\WindowsPowerShell\DscService\Modules'. When a client pulls its configuration, it will automatically download any DSC resource modules it requires to execute the .mof. Check out this URL for details:

    If you are using a PUSH model, then I would recommend you to ensure that the necessary DSC resources are already in place prior to executing your Configuration. That is what I did.

    Good luck,

  • #70424

    Points: 101
    Helping Hand
    Rank: Participant

    If the 2nd step is failing check that the 1st step has installed the DSC resources correctly by running get-dscresource on that node. If this does not return "xWebAdministration" then part one has failed.

The topic ‘How do I compile DSC to MOF if required module is not yet available’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort