public/helper/Send-TwitterBlocks_Destroy.ps1
function Send-TwitterBlocks_Destroy { <# .SYNOPSIS Mute, block and report users .DESCRIPTION POST blocks/destroy Un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user when successful. If relationships existed before the block was instantiated, they will not be restored. .PARAMETER screen_name The screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID. .PARAMETER user_id The ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name. .PARAMETER include_entities The entities node will not be included when set to false . .PARAMETER skip_status When set to either true , t or 1 statuses will not be included in the returned user objects. .NOTES This helper function was generated by the information provided here: https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-blocks-destroy #> [CmdletBinding()] Param( [string]$screen_name, [string]$user_id, [string]$include_entities, [string]$skip_status ) Begin { [hashtable]$Parameters = $PSBoundParameters $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) } [string]$Method = 'POST' [string]$Resource = '/blocks/destroy' [string]$ResourceUrl = 'POST https://api.twitter.com/1.1/blocks/destroy.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 { } } |