-
Notifications
You must be signed in to change notification settings - Fork 525
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
DRG: New M365DSCDRGUtil.psm1 for reusable DRG functions #3309
Comments
+1 Also, all the ConvertTo- (String, complexobject, etc.) function shouldn't be found a separate functions in each resource, but instead should be defined only once in a central module. |
I agree, I developed those functions independently as I didn't want to modify M365DSCUtil and there was a lot of modification since first version |
I would create one PR that would contain
We had big PRs in the past, that did not cause any issues. |
Sounds like a plan - I'll post that PR along with #3298 changes |
@William-Francillette any updates on this. Where are we at with centralizing the function and removing it from all resources? Thanks |
I was delayed with the setting catalog resource generator which is still not ready. |
Thanks for the update, appreciate your help! |
Quick update on this PR: Will post that PR asap |
update: Next phase of the test will be the resource export - I'll keep you posted |
There is a dedicated module within M365DSC to create stubs: https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 Looks like, this file misses some of the dependencies... |
Thanks @andikrueger - got that one, I will update with that PR |
Phase 2A - Export
|
@William-Francillette Hi, did you really encounter resources with semicolons? I really thought this wasn't true anymore so my latest iteration on that PR doesn't cover that, only single colons in an whole line. Could you please share one of those examples so I can update the PR? |
just updated the PR with this chunk: if ($IsCIMArray)
{
$DSCBlock = $DSCBlock.Replace("},`r`n", "`}`r`n")
#$DSCBlock = $DSCBlock.Replace("`r`n,`r`n", "`r`n") # see below
#$DSCBlock = $DSCBlock.Replace("`r`n;`r`n", "`r`n") # see below
$DSCBlock = $DSCBlock -replace "`r`n\s*[,;]`r`n", "`r`n" # replace "<crlf>[<whitespace>][,;]<crlf>" with "<crlf>"
} |
Quick update (I was off last week): I have tested all modified AAD resources for compilation successfully I will be posting a PR in ReverseDSC for trailing character soon I have started testing update for those resources but haven't completed yet as I found some issues Hope posting this PR this week |
AAD resources test completed 🥳 |
ok just finished to merge with latest V2.0 update - I will need to retest everything as I had to resolve many conflict manually I hope pushing this PR in the week end ( I was nearly done lol 🥲) |
@William-Francillette Really looking forward for this, great work! I know it's not related but didn't want to create a new issue just for it, would it be possible to update the DRG to create new types of instances for Assignments as @NikCharlebois requested, e.g. MSFT_IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolledAssignments instead of being hardcoded to MSFT_DeviceManagementConfigurationPolicyAssignments? I'm asking about this because it'd really ease the work on my side because on a next step I'd like to have that object extended to accept also DisplayName and not only GroupID, right now I have my code adapted to connect to Graph in order to translate GroupId to DisplayName and vice-versa. |
PR: M365DSCDRGUtil module + Resource Clean-up - Fixes #3309
While browsing the code for some additional information for an issue, I came across the following functions:
https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/DSCResources/MSFT_AADAdministrativeUnit/MSFT_AADAdministrativeUnit.psm1#L1057-L1743
This looks like to be part of the DRG Template. These functions should be removed from all resources and be bundled in a separate module under Modules: M365DSCDRGUtil.psm1
@William-Francillette and @NikCharlebois any thoughts on this?
The text was updated successfully, but these errors were encountered: