Get-TwilioApplication.ps1

function Get-TwilioApplication
{
    param(    
    [Management.Automation.PSCredential]
    $Credential
    )
    
    process {
        if (-not $Credential) {
            $credential = Get-TwilioCredential -ValueOnly | Select-Object -First 1 
            
        }
        if (-not $Credential) {
            Write-Error "No Twilio Credential provided. Use -Credential or Set-TwilioCredential first"               
            return
        }

        $getWebParams = @{
            WebCredential=$Credential
            Url="https://api.twilio.com/2010-04-01/Accounts/$($Credential.GetNetworkCredential().Username.Trim())/Applications"           
            AsXml =$true            
            UseWebRequest = $true
        }        
        Get-Web @getwebParams -Verbose |            
            Select-Object -ExpandProperty TwilioResponse
            
              
    }       
}