protected override void ExecuteCmdlet() { if (ParameterSpecified(nameof(Identity))) { var groupId = Identity.GetGroupId(HttpClient, AccessToken); if (groupId != null) { WriteObject(TeamsUtility.GetTeam(AccessToken, HttpClient, groupId)); } else { throw new PSArgumentException("Team not found"); } } else { WriteObject(TeamsUtility.GetTeams(AccessToken, HttpClient), true); } }