Avatax.psm1

<#
    .SYNOPSIS
    Avatax remove company
#>

function Remove-Company 
{
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true, Position=1)] [String] $url,
        [parameter(Mandatory=$true, Position=2)] [String] $key,
        [parameter(Mandatory=$true, Position=3)] [String] $accountId,
        [parameter(Mandatory=$true, Position=4)] [String] $companyToDeleteAvataxId
    )
    
    $encodedBytes = [System.Text.Encoding]::UTF8.GetBytes("$($accountId):$($key)")
    $encodedAuth =[Convert]::ToBase64String($encodedBytes)
    $basicAuth = "Basic $encodedAuth"

    Invoke-RestMethod -Method Delete -Uri "$($url)/companies/$($companyToDeleteAvataxId)" -Headers @{Authorization = $basicAuth} -ContentType "application/json" 
}