簡體   English   中英

Windows Server 2012R2 Core - 無法運行 powershell DSC

[英]Windows Server 2012R2 Core - can't run powershell DSC

安裝全新的 Windows Server 2012R2 核心安裝后,我創建了一個示例 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

將安裝配置加載到當前會話中,以便您可以使用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM