Private/Get-ChannelsPaged.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function Get-ChannelsPaged {
    Param (
        [Parameter(Mandatory)]
        [int]$Page,
        [ValidateSet('exclude_archived', 'private_exclude', 'private', 'archived', 'external_shared')]
        [string]$Mode = 'exclude_archived'
    )

    $FormData = @{
        module                 = 'channels'
        channel_type           = $Mode
        exclude_my_channels    = 0
        page                   = $Page
    }

    if ($ExcludeMyChannels) {
        $FormData.exclude_my_channels = 1
    }

    Invoke-SearchRequest -FormData $FormData
}