Auth0ConnectionEx.psm1

Import-Module Auth0

function Search-Auth0Connection {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true, Position=1)] [Auth0Context] $Context,
        [parameter(Mandatory=$true, Position=2)] [String] $Name = ''
    )

    $webClient = New-Object System.Net.WebClient
    #$webClient.Encoding = [System.Text.Encoding]::UTF8
    $webClient.Headers.Add('Authorization', $Context.Token.token_type + ' ' + $Context.Token.access_token)    
    return $webClient.DownloadString('https://' + $Context.Domain + '/api/v2/connections?per_page=1&page=0&name=' + $Name) | ConvertFrom-Json    
}