【发布时间】:2018-09-21 01:15:28
【问题描述】:
只是尝试创建一个脚本来安装 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.
知道是什么问题吗?
【问题讨论】:
标签: azure azure-devops dsc