-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any cmdlet or resource using ConvertTo-DSCObject may not provide intended results #3980
Comments
That's the reason I've created those functions as the original were not able to manage complex objects
|
Is there any chance to port these functions to DSCParser or do they function entirely different? |
@William-Francillette They tackle different problems though, I require a cmdlet that can convert resources in a blueprint in a pure string format and that's what ConvertTo-DSCObject is for but it's just not working correctly, your cmdlets, which are literally required these days, on the other hand they take as input powershell objects instead of string am I wrong? |
Get-M365DSCDRGComplexTypeToString will be able to convert cim objects to string |
I actually need the reverse :) |
Oh my bad 😅 I misunderstood it |
I already got the feeling, that the M365DSC native function would not work in DSCParser. @NikCharlebois Could you have a look at this issue? Presumably, this might also break the M365DSCRuleEvaluation resource. |
@NikCharlebois @andikrueger Did you have any luck with this? I really need IntuneSettingCatalogCustomPolicyWindows10 to be working with ConvertTo-DSCObject since my application depends on it and right now I have it excluded from it. |
@ykuijs Awesome work on your fix microsoft/DSCParser#36! I've been testing ConvertTo-DSCObject for several hours and it works flawlessly for the resources that didn't work AND it still works for everything else so this issue can also be closed. Thank you! Thank you! Thank you! |
Hi All, I suspect that the same issue is prevalent on Exchange Transport Rules. #4377 is the reference |
@jagatjb No, in this case you have a different issue than the one I reported here, as @andikrueger explained in the issue you've raised there's an escaping problem on a few properties. |
Description of the issue
ConvertTo-DSCObject seems to be tripping on some kind of resources, I've seen so far at least on IntuneDeviceConfigurationKioskPolicyWindows10 and IntuneSettingCatalogCustomPolicyWindows10, and I already reported this on microsoft/DSCParser#34 several months ago.
The issue here is not only do I need to invoke it from our own internal solution (it's critical that this works 100%), it's also being invoked within M365DSC itself on resource M365DSCRuleEvaluation and cmdlets Get-M365DSCConfigurationConflict, Assert-M365DSCBlueprint and Initialize-M365DSCReporting so if any of these use the affected resources with the conditions found in the attached blueprint then ConvertTo-DSCObject will not be able to convert the blueprint objects to powershell objects correctly.
At first glance it looks like it doesn't understand when within a complex object right afterwards there's one of its subproperties that itself is another complex object so it seems to be missing some recursive calling in DSCParser module.
Microsoft 365 DSC Version
1.23.1122.1
Which workloads are affected
other
The DSC configuration
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: