Search code examples
dsc

Invoke-DscResource on WindowsFeatureSet fails


Invoking Invoke-DSCResource on WindowsFeatureSet fails with strange error.

Invoke-DscResource -Name WindowsFeatureSet -Property @{Name = 'FileAndStorage'; Ensure = 'Present' } -Method test -ModuleName PSDesiredStateConfiguration

Invoke-DscResource : Failed to serialize properties into CimInstance. At line:5 char:1 + Invoke-DscResource -Name WindowsFeatureSet -Property @{Name = 'FileAn ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Invoke-DscResource], SerializationException + FullyQualifiedErrorId : System.Runtime.Serialization.SerializationException,Microsoft.PowerShell.DesiredStateConfiguration.Commands.InvokeDscResourceMethodCommand


Solution

  • This is a known issue. There is an issue filed in PowerShell User Voice, which is marked as 'Survey'. 'Survey' indicates 'We saw this and we are considering it...' per the PowerShell User Voice Home Page.

    This is also documented in Chef Discourse here.

    And there is an issue open to update the Chef Documentation [here] (https://github.com/chef/chef-web-docs/issues/59) and DSC Documentation here.