public/helper/Get-TwitterUsers_Show.ps1
function Get-TwitterUsers_Show { <# .SYNOPSIS Follow, search, and get users .DESCRIPTION GET users/show Returns a variety of information about the user specified by the required user_id or screen_name parameter. The author's most recent Tweet will be returned inline when possible. GET users / lookup is used to retrieve a bulk collection of user objects. You must be following a protected user to be able to see their most recent Tweet. If you don't follow a protected user, the user's Tweet will be removed. A Tweet will not always be returned in the current_status field. .PARAMETER user_id The ID of the user for whom to return results. Either an id or screen_name is required for this method. .PARAMETER screen_name The screen name of the user for whom to return results. Either a id or screen_name is required for this method. .PARAMETER include_entities The entities node will not be included when set to false. .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-show #> [CmdletBinding()] Param( [string]$user_id, [string]$screen_name, [string]$include_entities ) Begin { [hashtable]$Parameters = $PSBoundParameters $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) } [string]$Method = 'GET' [string]$Resource = '/users/show' [string]$ResourceUrl = 'https://api.twitter.com/1.1/users/show.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 { } } |