0

Background: When creating a Custom DSC Resource using the DSC resource designer you can specify a New-xDscResourceProperty with a type of PSCredential[] (PSCredential array).

Problem: When I create an extemely simple custom resource that uses the PSCredential array type I run into an error from the LCM. I can generate the mof file with my new custom resource just fine. However when I try to call Start-DscConfiguration against my target machine I get the following error from the LCM

VERBOSE: [{MyMachineName}]: LCM:  [ Start  Resource ]  [[MyCustomResource]CustomResource]
VERBOSE: [{MyMachineName}]: LCM:  [ End    Set      ]
MI_Instance_GetElement failed.
  + CategoryInfo          : InvalidType: (root/Microsoft/...gurationManager:String) [], CimException
  + FullyQualifiedErrorId : MI RESULT 13
  + PSComputerName        : {MyMachineName}

As you can see the LCM errors out before even calling any of the resources functions ie: Test,Set -TargetResource. I have even set the Enable-DscDebug on the LCM and the LCM does NOT break into the custom resource for debugging. It seems to me that the LCM just doesnt know how to handle a PSCredential array.

I have searched the web for "MI RESULT 13" with no results found anywhere: google/powershell forums/here.

Has anyone been able to create a custom DSC resource with the PSCredential array and able to run the configuration against a machine?

Any simple custom "Hello world" dsc resource I create with a PSCredential array throws this error.

4

0 回答 0