-
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
Add exact match parameter to avoid invalid multiple results #3737
Add exact match parameter to avoid invalid multiple results #3737
Conversation
@@ -365,7 +365,7 @@ function Export-TargetResource | |||
$totalCount = $instances.Length | |||
foreach ($item in $instances) | |||
{ | |||
$Group = Find-CsGroup -SearchQuery $item.GroupId | |||
$Group = Find-CsGroup -SearchQuery $item.GroupId -ExactMatchOnly $true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to understand what the outcome would be here. If we have two instances with the same name, we should print a warning letting the user know we won't be exporting them like we do for other resource (e.g., AADApplication) instead of trying to determine which ones to export or skip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I update the PR to support this case.
Now we are using the original groupId (unique) and and use the first display name (are they are all exactly equals).
I think we don't need any warning with this behaviour.
WDYT ?
4917c96
to
5914d7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor remarks
...soft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1
Outdated
Show resolved
Hide resolved
...soft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1
Show resolved
Hide resolved
4ae53af
to
c80dc30
Compare
c80dc30
to
699f1c5
Compare
Pull Request (PR) description
Export may found multiple values for CsGroup.DisplayName and CSGroup.GroupId, then creates invalid export
This Pull Request (PR) fixes the following issues
Fixes #3736