我試圖在本地運行一個非常簡單的Powershell DSC腳本。 (我從來沒有計劃在這個階段拉或推配置文件)如何在本地運行Powershell DSC腳本
我收到以下錯誤消息。 WS-Management服務正在運行,但沒有防火牆漏洞或端口保留(服務器恰好是一個web服務器)...有沒有反正我可以允許這個服務器只接受本地請求?
The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". + CategoryInfo : ConnectionError: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : HRESULT 0x80338012 + PSComputerName : localhost
configuration SampleIISInstall
{
Node 127.0.0.1
{
File FileDemo {
Type = 'Directory'
DestinationPath = 'C:\TestUser3'
Ensure = "Present"
}
}
}
# Compile the configuration file to a MOF format
SampleIISInstall
# Run the configuration on localhost
Start-DscConfiguration -Path .\SampleIISInstall -Wait -Force -Verbose