You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
The DSC wrapper module for gpregistrypolicydsc experiencesconstant corrective changes and warnings when managing reg_dword resources due to a case mismatch in the GPRegistryPolicyFileParser.psm1 and the valuemap within the resources schema file.
The GetRegTypeString() method in GPRegistryPolicyFileParser.psm1 is returning the the following unsupported values:
[Write,Description("Indicates the type of the value."),ValueMap{"Binary","Dword","ExpandString","MultiString","Qword","String","None"},Values{"Binary","Dword","ExpandString","MultiString","Qword","String","None"}] String ValueType;
Verbose logs showing the problem
During a Puppet run, the dsc_registrypolicyfile resource generates warnings the existing registry file valuetype has been set to DWord. The schema expects this value to resolve as Dword
Warning: Provider returned data that does not match the Type Schema for `dsc_registrypolicyfile[Remove access to use all Windows Update features (Configure notifications)]`
Value type mismatch:
* dsc_valuetype: DWord (expects an undef value or a match for Enum['Binary', 'Dword', 'ExpandString', 'MultiString', 'None', 'Qword', 'String'], got 'DWord')
Suggested solution to the issue
Update the GetRegTypeString() method in GPRegistryPolicyFileParser.psm1 to return the correct valuetype's aligned with the resource schema mof file.
Since PowerShell normally is doing case-insensitive matching this is usually not an issue. If this cannot be resolved at the Puppet side, I suggest to avoid getting a regression that the resource (not the helper method of the class) should just output the value in either upper-case or lower-case depending on what is most appropriate. Add a unit test that validates that the resource actually always returns all values correctly. There should also be a unit test that also checks the MOF file so that the values there are not changed from either lower-case or upper-case (depending on the previous choice in the code).
Details of the scenario you tried and the problem that is occurring
The DSC wrapper module for gpregistrypolicydsc experiencesconstant corrective changes and warnings when managing reg_dword resources due to a case mismatch in the GPRegistryPolicyFileParser.psm1 and the valuemap within the resources schema file.
The GetRegTypeString() method in GPRegistryPolicyFileParser.psm1 is returning the the following unsupported values:
The expected values should be:
The file parser should output values aligned with the resource's schema file:
MSFT_RegistryPolicyFile.schema.mof
Verbose logs showing the problem
During a Puppet run, the dsc_registrypolicyfile resource generates warnings the existing registry file valuetype has been set to
DWord
. The schema expects this value to resolve asDword
Suggested solution to the issue
Update the GetRegTypeString() method in GPRegistryPolicyFileParser.psm1 to return the correct valuetype's aligned with the resource schema mof file.
GPRegistryPolicyDsc/source/Modules/GPRegistryPolicyFileParser/GPRegistryPolicyFileParser.psm1
Line 638 in c827c54
Dword
instead ofDWord
.Qword
instead ofQWord
.Original:
Updated:
Version of the DSC module that was used
Version 1.2.0.
@johlju @PlagueHO @gaelcolas @danielboth @jcwalker
Please review and assist where possible, should be a simple matter of swapping from upper to lower case for the affected characters.
The text was updated successfully, but these errors were encountered: