Public/Get-GW2Logos.ps1
|
<#
.SYNOPSIS Retrieves miscellaneous animated logos. .DESCRIPTION This function retrieves miscellaneous animated logos from the Guild Wars 2 API. It supports retrieving specific logos by ID or all logos. .PARAMETER Ids The ID(s) of the logos to retrieve. Can be a single ID, an array of IDs, or "all". .EXAMPLE Get-GW2Logos -Ids "ArenaNet-Path-of-Fire-logo" Retrieves specific logos. .EXAMPLE Get-GW2Logos -Ids "all" Retrieves all logos. .LINK https://wiki.guildwars2.com/wiki/API:2/logos #> function Get-GW2Logos { [CmdletBinding()] param ( [Parameter(Mandatory = $false)] [object]$Ids ) $Uri = "https://api.guildwars2.com/v2/logos" $QueryParams = @{} if ($null -ne $Ids) { if ($Ids -is [array]) { $QueryParams["ids"] = $Ids -join "," } elseif ($Ids -eq "all") { $QueryParams["ids"] = "all" } else { $QueryParams["ids"] = $Ids } } try { Invoke-RestMethod -Uri $Uri -Method Get -Body $QueryParams } catch { Write-Error "Failed to retrieve logos: $_" } } |