安装全新的Windows Server 2012R2 Core安装后,我创建了一个示例DSC进行测试并收到:术语“安装程序”未识别为名称...
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
将安装程序配置加载到当前 session 中,以便您可以使用它。
关于powershell - Windows Server 2012R2核心-无法运行Powershell DSC,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30783175/