-1

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?

learner
  • 2,480
  • 10
  • 50
  • 94

1 Answers1

1

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

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Hangar18
  • 26
  • 3
  • Shall try on Monday and provide you feedback. – learner Sep 21 '18 at 12:11
  • Very good, works well now. Thank you for your assistance. May I know where is the great place/website/url to learn PowerShell DSC for Azure Automation? – learner Sep 22 '18 at 12:28