当我执行命令加工时,我收到以下错误 -
PS C:\Windows\system32> $cimsession = New-CimSession -Credential (Get-Credential -UserName "test" -Message "test") -ComputerName test.cloudapp.net -Port 58718 -SessionOption $cimsessionoption
PS C:\Windows\system32> Get-DscConfiguration -CimSession $cimsession
Get-DscConfiguration : Current configuration does not exist. Execute Start-DscConfiguration command with -Path parameter to specify a
configuration file and create a current configuration first.
At line:1 char:1
+ Get-DscConfiguration -CimSession $cimsession
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration],
CimException
+ FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration
+ PSComputerName : powerlabdns.cloudapp.net
这是什么意思?
答案 0 :(得分:3)
您没有执行DSC文件,您正在请求当前不存在的DSC配置(如错误所示)。
您需要首先再次运行Start-DscConfiguration
,因为错误说明了。您必须将-Path
传递给该调用,该调用是MOF文件(已编译的配置)所在的目录(相对于目标节点)。
一旦这样做,您就可以致电Get-DscConfiguration
查看当前配置。