public/helper/Get-TwitterOauth_Authorize.ps1

function Get-TwitterOauth_Authorize {
<#
.SYNOPSIS
    Authentication

.DESCRIPTION
    GET oauth/authorize
    
    Allows a Consumer application to use an OAuth Request Token to request user authorization. This method fulfills Section 6.2 of the OAuth 1.0 authentication flow. Desktop applications must use this method (and cannot use GET oauth / authenticate).
    
    Usage Note: An oauth_callback is never sent to this method, provide it to POST oauth / request_token instead.

.PARAMETER force_login
    Forces the user to enter their credentials to ensure the correct users account is authorized.

.PARAMETER screen_name
    Prefills the username input box of the OAuth login screen with the given value.

.NOTES
    This helper function was generated by the information provided here:
    https://developer.twitter.com/en/docs/basics/authentication/api-reference/authorize

#>

    [CmdletBinding()]
    Param(
        [string]$force_login,
        [string]$screen_name
    )
    Begin {

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

        [string]$Method      = 'GET'
        [string]$Resource    = '/oauth/authorize'
        [string]$ResourceUrl = 'https://api.twitter.com/oauth/authorize'

    }
    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 {

    }
}