if($Name-and-not$HasWildCard){# torn between independent queries, or filtering groups.list# submit a PR if this isn't performant enough or doesn't make sense.$Groups=$RawGroups.groups|Where{$Name-Contains$_.name}}elseif($Name-and$HasWildCard){$AllGroups=$RawGroups.groups# allow like operator on each group requested in the param, avoid dupes$GroupHash=[ordered]@{}foreach($SlackGroupin$AllGroups){foreach($Chanin$Name){if($SlackGroup.Name-like$Chan-and-not$GroupHash.Contains($SlackGroup.id)){$GroupHash.Add($SlackGroup.Id,$SlackGroup)}}}$Groups=$GroupHash.Values}else# nothing specified{$Groups=$RawGroups.groups}