2

新しい 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 マシンでは、これは問題なく動作します。これを機能させるためにインストールまたは構成する必要があるものはありますか?

4

1 に答える 1

2

行に小さな間違いがあります:

.\dsc.ps1

それは言うべきです

. .\dsc.ps1

セットアップ構成を現在のセッションにロードして、使用できるようにします。

于 2015-06-11T15:01:40.497 に答える