-
Notifications
You must be signed in to change notification settings - Fork 396
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
Added new switch to allow inclusion of all class teams #49
base: master
Are you sure you want to change the base?
Added new switch to allow inclusion of all class teams #49
Conversation
function Get-SDSTeams($logFilePath) { | ||
$initialSDSGroupUri = "https://graph.microsoft.com/beta/groups?`$filter=groupTypes/any(c:c+eq+'Unified')+and+startswith(mailNickname,'Section_')+and+resourceProvisioningOptions/Any(x:x+eq+'Team')&$groupSelectClause" | ||
function Get-SDSTeams($IncludeNonSDSGroups, $logFilePath) { | ||
$initialSDSGroupUri = "https://graph.microsoft.com/beta/groups?`$filter=groupTypes/any(c:c+eq+'Unified')" + $(if(-Not $IncludeNonSDSGroups) {"+and+startswith(mailNickname,'Section_')"}) + "+and+resourceProvisioningOptions/Any(x:x+eq+'Team')&$groupSelectClause" |
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 think this can be made easier to read. Either:
$initialSDSGroupUri = "https://graph.microsoft.com/beta/groups?$groupSelectClause&`$filter=groupTypes/any(c:c+eq+'Unified')+and+resourceProvisioningOptions/Any(x:x+eq+'Team')" + $(if(-Not $IncludeNonSDSGroups) {"+and+startswith(mailNickname,'Section_')"})
OR
$initialSDSGroupUri = "https://graph.microsoft.com/beta/groups?$groupSelectClause&`$filter=groupTypes/any(c:c+eq+'Unified')+and+resourceProvisioningOptions/Any(x:x+eq+'Team')"
if (-Not $IncludeNonSDSGroups) {
$initialSDSGroupUri = "$initialSDSGroupUri+and+startswith(mailNickname,'Section_')"
}
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.
Addressed
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.
The pertinent part of this was to eliminate the inline, middle of the string if (-Not $includeNonSdsGroups) and make it a possible suffix, to limit the risk of the $select statement being ignored. Your new version still has the $filter at the start.
@@ -127,12 +130,19 @@ function PageAll-GraphRequest($initialUrl, $logFilePath) { | |||
|
|||
$groupSelectClause = "`$select=id,mailNickname,emailAddress,displayName,resourceProvisioningOptions" | |||
|
|||
function Check-Team($group) { | |||
function Check-Team($IncludeNonSDSGroups, $group) { | |||
if (($group.resourceProvisioningOptions -ne $null) -and $group.resourceProvisioningOptions.Contains("Team") -and $group.mailNickname.StartsWith("Section_")) { |
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 think you need to also remove the last filter.
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.
Addressed
No description provided.