public/helper/Send-TwitterFriendships_Update.ps1

function Send-TwitterFriendships_Update {
<#
.SYNOPSIS
    Follow, search, and get users
 
.DESCRIPTION
    POST friendships/update
     
    Enable or disable Retweets and device notifications from the specified user.
 
.PARAMETER screen_name
    The screen name of the user being followed.
 
.PARAMETER user_id
    The ID of the user being followed.
 
.PARAMETER device
    Enable/disable device notifications from the target user.
 
.PARAMETER retweets
    Enable/disable Retweets from the target user.
 
.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/post-friendships-update
 
#>

    [CmdletBinding()]
    Param(
        [string]$screen_name,
        [string]$user_id,
        [string]$device,
        [string]$retweets
    )
    Begin {

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

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

        $OAuthSettings = Get-TwitterOAuthSettings -Resource $Resource
        Invoke-TwitterAPI -Method $Method -ResourceUrl $ResourceUrl -Parameters $Parameters -OAuthSettings $OAuthSettings

    }
    End {

    }
}