Windows Server 2012R2 Core - 不能 运行 powershell DSC
Windows Server 2012R2 Core - can't run powershell DSC
安装全新 Windows Server 2012R2 Core 安装后,我创建了一个示例 DSC 进行测试并收到:术语 "Setup" 未被识别为名称 ...
c:\src\dsc.ps1
Configuration Setup
{
Node .
{
WindowsFeature "IIS"
{
Ensure = "Present"
Name = "Web-Server"
}
}
}
C:\src> .\dsc.ps1
C:\src> Setup
Setup : The term 'Setup' 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.
At line:1 char:1
+ Setup
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (Setup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
在我的本地 Windows 机器上,这没有任何问题。我需要安装或配置什么才能使它正常工作吗?
行中有一个小错误:
.\dsc.ps1
应该是
. .\dsc.ps1
将安装程序配置加载到当前会话中以便您可以使用它。
安装全新 Windows Server 2012R2 Core 安装后,我创建了一个示例 DSC 进行测试并收到:术语 "Setup" 未被识别为名称 ...
c:\src\dsc.ps1
Configuration Setup
{
Node .
{
WindowsFeature "IIS"
{
Ensure = "Present"
Name = "Web-Server"
}
}
}
C:\src> .\dsc.ps1
C:\src> Setup
Setup : The term 'Setup' 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.
At line:1 char:1
+ Setup
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (Setup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
在我的本地 Windows 机器上,这没有任何问题。我需要安装或配置什么才能使它正常工作吗?
行中有一个小错误:
.\dsc.ps1
应该是
. .\dsc.ps1
将安装程序配置加载到当前会话中以便您可以使用它。