Problem description
When a calss-based DSC resource is built using the pattern that DscResource.Base provides it is an option to set the flag FeatureOptionalEnums which allows an optional DSC property to use an Enum type. The enum value 0 is then ignored and considered to be equivalent to parameter set to $null. The command Get-DscProperty does not handle this and will return a property with the value 0 as a property that is set. 0 means user did not provide a value using the previous mentioned pattern and should have been ignored or seen as a property that is not set.
Verbose logs
How to reproduce
Call Get-DscProperty with a property with an enum type and the value set to 0.
Expected behavior
Possible to to tell the command to ignore the enums with a value of zero.
Current behavior
Command will always return the propetty even if it is set to zero.
Suggested solution
Add an optional property IgnoreZeroEnumValue that will check if the datatype is enum and then if the value is zero, it will be skipped/ignored the same way as the command skips/ignores null value properties.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used
Problem description
When a calss-based DSC resource is built using the pattern that DscResource.Base provides it is an option to set the flag
FeatureOptionalEnumswhich allows an optional DSC property to use an Enum type. The enum value 0 is then ignored and considered to be equivalent to parameter set to$null. The commandGet-DscPropertydoes not handle this and will return a property with the value 0 as a property that is set. 0 means user did not provide a value using the previous mentioned pattern and should have been ignored or seen as a property that is not set.Verbose logs
How to reproduce
Call
Get-DscPropertywith a property with an enum type and the value set to0.Expected behavior
Possible to to tell the command to ignore the enums with a value of zero.
Current behavior
Command will always return the propetty even if it is set to zero.
Suggested solution
Add an optional property
IgnoreZeroEnumValuethat will check if the datatype is enum and then if the value is zero, it will be skipped/ignored the same way as the command skips/ignores null value properties.Operating system the target node is running
PowerShell version and build the target node is running
Module version used