PSDscResources icon indicating copy to clipboard operation
PSDscResources copied to clipboard

WindowsOptionalFeature: Get-DscConfiguration fails

Open kev494 opened this issue 7 years ago • 1 comments

After applying a DSC configuration with a WindowsOptionalFeature resource, the cmdlet get-dscconfiguration fails.

Get-DscConfiguration : GetConfiguration did not succeed.
At line:1 char:1
+ Get-DscConfiguration
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration

I am seeing the following error message in event viewer:

Message Unable to cast object of type 'System.String' to type 'System.Collections.IList'. Parameter name: value HResult -2147024809 StackTrack at Microsoft.Management.Infrastructure.Internal.Data.CimPropertyOfInstance.set_Value(Object value) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetTargetResource(IntPtr resourceConfigurationInstanceHandle, IntPtr nonResourcePropetiesHandle, IntPtr metaConfigHandle, IntPtr regInstanceHandle, IStreamHandler plugInStreamsHandler, IntPtr& outputInstanceHandle, IntPtr& errorInstanceHandle) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscPluginManagedEntryWrapper.Get(IntPtr provContext, IntPtr instance, IntPtr nonResourcePropeties, IntPtr metaConfig, IntPtr regInstance, IntPtr outputInstance, IntPtr extendedError)

The configuration itself works and windows feature is enabled. Btw I have also tested it with the sample script of yours.

Thank you for investigating

kev494 avatar Jul 10 '18 13:07 kev494

The same issue was reported in issue https://github.com/PowerShell/xPSDesiredStateConfiguration/issues/432. This sounds like a bug, labeling it as such, and help wanted so anyone in the community can help with this one.

johlju avatar Jul 16 '18 13:07 johlju