Public/Get-GW2CommerceExchange.ps1

<#
    .SYNOPSIS
        Retrieves the list of available commerce exchange endpoints.
 
    .DESCRIPTION
        The Get-GW2CommerceExchange cmdlet retrieves the list of available currency exchange endpoints (coins/gems).
 
    .EXAMPLE
        Get-GW2CommerceExchange
        Retrieves available exchange types.
 
    .NOTES
        API Endpoint: /v2/commerce/exchange
    #>

function Get-GW2CommerceExchange {
    
    [CmdletBinding()]
    param ()

    $Uri = "https://api.guildwars2.com/v2/commerce/exchange"

    try {
        Invoke-RestMethod -Uri $Uri -Method Get
    }
    catch {
        Write-Error "Failed to retrieve commerce exchange endpoints: $_"
    }
}