Example #1
0
 protected override void ExecuteCmdlet()
 {
     if (ParameterSpecified(nameof(Identity)))
     {
         var groupId = Identity.GetGroupId(HttpClient, AccessToken);
         if (groupId != null)
         {
             WriteObject(TeamsUtility.GetTeamAsync(AccessToken, HttpClient, groupId).GetAwaiter().GetResult());
         }
     }
     else
     {
         WriteObject(TeamsUtility.GetTeamsAsync(AccessToken, HttpClient).GetAwaiter().GetResult(), true);
     }
 }
Example #2
0
 protected override void ExecuteCmdlet()
 {
     if (ParameterSpecified(nameof(Identity)))
     {
         var groupId = Identity.GetGroupId(HttpClient, AccessToken);
         if (groupId != null)
         {
             WriteObject(TeamsUtility.GetTeamAsync(AccessToken, HttpClient, groupId).GetAwaiter().GetResult());
         }
         else
         {
             WriteError(new PSArgumentException("Team not found"), ErrorCategory.ObjectNotFound);
         }
     }
     else
     {
         WriteObject(TeamsUtility.GetTeamsAsync(AccessToken, HttpClient).GetAwaiter().GetResult(), true);
     }
 }