public/helper/Get-TwitterUsers_Suggestions_SlugMembers.ps1

function Get-TwitterUsers_Suggestions_SlugMembers {
<#
.SYNOPSIS
    Follow, search, and get users
 
.DESCRIPTION
    GET users/suggestions/:slug/members
     
    Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
 
.PARAMETER slug
    The short name of list or a category
 
.NOTES
    This helper function was generated by the information provided here:
    https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-suggestions-slug-members
 
#>

    [CmdletBinding()]
    Param(
        [string]$slug
    )
    Begin {

        [hashtable]$Parameters = $PSBoundParameters
                   $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) }

        [string]$Method      = 'GET'
        [string]$Resource    = '/users/suggestions/:slug/members'
        [string]$ResourceUrl = 'https://api.twitter.com/1.1/users/suggestions/:slug/members.json'

    }
    Process {

        # Find & Replace any ResourceUrl parameters.
        $UrlParameters = [regex]::Matches($ResourceUrl, '(?<!\w):\w+')
        ForEach ($UrlParameter in $UrlParameters) {
            $UrlParameterValue = $Parameters["$($UrlParameter.Value.TrimStart(":"))"]
            $ResourceUrl = $ResourceUrl -Replace $UrlParameter.Value, $UrlParameterValue
        }

        If (-Not $OAuthSettings) { $OAuthSettings = Get-TwitterOAuthSettings -Resource $Resource }
        Invoke-TwitterAPI -Method $Method -ResourceUrl $ResourceUrl -Parameters $Parameters -OAuthSettings $OAuthSettings

    }
    End {

    }
}