dsccommunity / xPSDesiredStateConfiguration

DSC resources for configuring common operating systems features, files and settings.
https://dsccommunity.org
MIT License
211 stars 135 forks source link

xWindowsOptionalFeature: Get-DscConfiguration fails with error message #432

Open Bamboocha87 opened 6 years ago

Bamboocha87 commented 6 years ago

Hi,

Get-DscConfiguration fails with error message: 'Unable to cast object of type 'System.String' to type 'System.Collections.IList'.

we have a problem with the module xWindowsOptionalFeature. We set the following configuration in our dsc script:

xWindowsOptionalFeature EnableDotNet35
{
      Name = "NetFx3"
      Ensure = "Present"
      NoWindowsUpdateCheck =$true
}

The configuration will be applied, but if you run Get-DscConfiguration, we have the following issues:

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)

This event indicates that failure happens when LCM is processing the configuration. Error Id is 0x1. Error Detail is The SendConfigurationApply function did not succeed.. Resource Id is [xWindowsOptionalFeature]EnableDotNet35 and Source Info is E:\_GIT\Desired State Configuration Source\its-ccm-windows-baseline.ps1::344::5::xWindowsOptionalFeature. Error Message is NULL.

Thanks for helping

johlju commented 6 years ago

Labeling this as bug and help wanted so that anyone in the community can run with it.