You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to generate an array of all messages in a channel but this command is apparently limited to 50 messages. Get-MgTeamChannelMessage -TeamId $team.id -ChannelId $channel.id -PageSize 50
returns 50 message but Get-MgTeamChannelMessage -TeamId $team.id -ChannelId $channel.id -PageSize 51
throws the error "Limit of '50' for Top Query has been exceeded." I didn't specify a Top query
if you use the -Top parameter with anything over 50 you get the same error, the -All parameter does the same thing.
I understand API limits but having to get 50 messages, then do another query with a -Skip 50 and add to the array, then do a -Skip 100 (rinse repeat) seems ridiculous!
I can't find any workaround for this in the relatively sparse documentation for these modules.
But that just seems stupid. If the max allowed page size is 50 (The C# code says the max is 999) then the -All parameter should automatically set the -PageSize to 50, we should not have to provide it is we want ALL messages.
We should update the paging logic to use the default payload count as the initial pageSize then follow the nextLink until the last item is retrieved.
The current implementation uses a default pageSize of 100, which conflicts with Teams' max allowed pageSize of 50. Note, the max allowed pageSize varies from service to service. Most services generally accept a pageSize of 100, but it appears Teams is an exception.
Note to self: Should AGS formalize a default page size/$top for all workloads?
Activity
Clifra-Jones commentedon Sep 24, 2021
OK I did figure out a work around by looking at the C# code.
Get-MgTeamChannelMessage -TeamId $Team.Id -ChannelId $Channel.Id -PageSize 50 -AllBut that just seems stupid. If the max allowed page size is 50 (The C# code says the max is 999) then the -All parameter should automatically set the -PageSize to 50, we should not have to provide it is we want ALL messages.
peombwa commentedon Sep 29, 2021
We should update the paging logic to use the default payload count as the initial pageSize then follow the nextLink until the last item is retrieved.
The current implementation uses a default pageSize of 100, which conflicts with Teams' max allowed pageSize of 50. Note, the max allowed pageSize varies from service to service. Most services generally accept a pageSize of 100, but it appears Teams is an exception.
Note to self: Should AGS formalize a default page size/$top for all workloads?
peombwa commentedon Jul 1, 2022
Will be fixed by #1361.
Closing as duplicate of #1351.