Public/Get-GW2HomesteadGlyphs.ps1

<#
.SYNOPSIS
Retrieves information about all available homestead glyphs.
 
.DESCRIPTION
Calls the Guild Wars 2 API v2 /homestead/glyphs endpoint.
- If no parameters are provided, returns a list of all available glyph IDs.
- If 'Ids' is provided, returns objects containing details for the specified glyphs.
 
.PARAMETER Ids
Optional. A list of glyph IDs (strings) to retrieve.
Example: "harvesting_glyph_1", "mining_glyph_1"
 
.EXAMPLE
Get-GW2HomesteadGlyphs
Returns a list of all glyph IDs.
 
.EXAMPLE
Get-GW2HomesteadGlyphs -Ids "harvesting_glyph_1"
Returns details for the specified glyph.
 
.notes
- Requires network access to api.guildwars2.com.
- This is a public endpoint and does not require an API key.
#>

function Get-GW2HomesteadGlyphs {
    param (
        [Parameter(Mandatory = $false)]
        [string[]]$Ids
    )
    
    $url = "https://api.guildwars2.com/v2/homestead/glyphs"

    if ($Ids) {
        # Join IDs with commas for the query parameter
        $idString = $Ids -join ','
        $url = $url + "?ids=$idString"
    }

    $response = Invoke-RestMethod -Uri $url -Method Get
    
    return $response
}