Search code examples
azureazure-devopsdsc

Issue with DSC Script


Just trying to create a script to install IIS and Management Tools and getting the error below, any idea what could be the cause of it?

Configuration iis_dsc_file
{
# Import the module that contains the resource we are using.

Import-DSCResource -ModuleName PsDesiredStateConfiguration
Import-module servermanager
# The Node statement specifices which targets this configuration will be applied to.
Node localhost
  {
  # Code to ensure IIS feature is enabled
  WindowsFeature WebServer
    {
    Ensure= "Present"
    Name= "Web-Server"
    }

  WindowsFeatures IISManagementTools {
    Name= "Web-Mgmt-Tools"
    Ensure= "Present"
    IncldueAllSubFeature= $True
    LogPath= "C:\ServerLogs\IIS-Installation-Log.txt"
    }
  }
}

The error message I get is below:

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The term 'WindowsFeatures' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Any idea what is the issue?


Solution

  • It fails because there is an extra S at the end of the second WindowsFeature

    By the way, IncldueAllSubFeature is misspelled too, it should be IncludeAllSubFeature