Public/InvoiceTaxes/Get-AspireInvoiceTaxes.ps1

<#
.SYNOPSIS
    Retrieves a list of invoice taxes from the Aspire API.
.DESCRIPTION
    Uses Invoke-AspireRequest to perform a GET request to the /InvoiceTaxes endpoint with support for OData query parameters.
.PARAMETER Filter
    Optional OData filter query (e.g., "TaxRate gt 0").
.PARAMETER Top
    Optional number of records to return (integer).
.PARAMETER Skip
    Optional number of records to skip (integer).
.PARAMETER Select
    Optional comma-separated list of fields to include (e.g., "InvoiceTaxID,TaxRate").
.PARAMETER Expand
    Optional comma-separated list of related entities to expand.
.PARAMETER OrderBy
    Optional OData orderby query (e.g., "TaxRate desc").
.PARAMETER PageNumber
    Optional page number for pagination.
.PARAMETER Limit
    Optional limit for the number of records.
.OUTPUTS
    The response from the API containing the list of invoice taxes.
.EXAMPLE
    Get-AspireInvoiceTaxes -Filter "TaxRate gt 0" -Top 10
#>

function Get-AspireInvoiceTaxes {
    [CmdletBinding()]
    param(
        [string]$Filter = $null,
        [int]$Top = $null,
        [int]$Skip = $null,
        [string]$Select = $null,
        [string]$Expand = $null,
        [string]$OrderBy = $null,
        [string]$PageNumber = $null,
        [string]$Limit = $null
    )

    $queryParams = @{}
    if ($Filter) {
        $queryParams['$filter'] = $Filter
    }
    if ($Top) {
        $queryParams['$top'] = $Top
    }
    if ($Skip) {
        $queryParams['$skip'] = $Skip
    }
    if ($Select) {
        $queryParams['$select'] = $Select
    }
    if ($Expand) {
        $queryParams['$expand'] = $Expand
    }
    if ($OrderBy) {
        $queryParams['$orderby'] = $OrderBy
    }
    if ($PageNumber) {
        $queryParams['$pageNumber'] = $PageNumber
    }
    if ($Limit) {
        $queryParams['$limit'] = $Limit
    }

    return Invoke-AspireRequest -Method GET -Path "/InvoiceTaxes" -QueryParams $queryParams
}