Skip to content

Get-MgTeamChannelMessage limits to 50 #874

@Clifra-Jones

Description

@Clifra-Jones

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions