WindowsOptionalFeature: Get-DscConfiguration fails
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
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.