Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Server 2012R2核心-can';t运行powershell DSC_Powershell_Windows Server_Dsc - Fatal编程技术网

Windows Server 2012R2核心-can';t运行powershell DSC

Windows Server 2012R2核心-can';t运行powershell DSC,powershell,windows-server,dsc,Powershell,Windows Server,Dsc,安装新的Windows Server 2012R2 Core安装后,我创建了一个示例DSC进行测试,并收到:术语“Setup”不被识别为名称 c:\src\dsc.ps1 Configuration Setup { Node . { WindowsFeature "IIS" { Ensure = "Present" Name = "Web-Server" } } } C:\s

安装新的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
将安装配置加载到当前会话中,以便您可以使用它