public/helper/Send-TwitterSavedSearches_Create.ps1

function Send-TwitterSavedSearches_Create {
<#
.SYNOPSIS
    Manage account settings and profile
 
.DESCRIPTION
    POST saved_searches/create
     
    Create a new saved search for the authenticated user. A user may only have 25 saved searches.
 
.PARAMETER query
    The query of the search the user would like to save.
 
.NOTES
    This helper function was generated by the information provided here:
    https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-create
 
#>

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

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

        [string]$Method      = 'POST'
        [string]$Resource    = '/saved_searches/create'
        [string]$ResourceUrl = 'https://api.twitter.com/1.1/saved_searches/create.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 {

    }
}