只是尝试创建一个脚本来安装IIS和管理工具,并在下面显示错误,您知道是什么原因造成的?
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 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.
你知道是什么问题吗?
答案 0 :(得分:1)
它失败,因为第二个WindowsFeature的末尾有一个额外的S。
顺便说一下,IncldueAllSubFeature也是拼错的,它应该是IncludeAllSubFeature