Public/Get-GW2WizardsVaultObjectives.ps1
|
<#
.SYNOPSIS Retrieves Wizard's Vault objectives. .DESCRIPTION The Get-GW2WizardsVaultObjectives cmdlet retrieves information about Wizard's Vault objectives (tasks). .PARAMETER Ids The ID(s) of the objectives to retrieve. Can be a single ID, an array of IDs, or "all". .PARAMETER Page The page number to retrieve. .PARAMETER PageSize The number of results per page. .PARAMETER Lang The language to return localized text in. Defaults to "en". Valid values: "en", "es", "de", "fr", "zh". .EXAMPLE Get-GW2WizardsVaultObjectives -Ids 1 Retrieves information for objective ID 1. .EXAMPLE Get-GW2WizardsVaultObjectives -Ids "all" Retrieves information for all objectives. .NOTES API Endpoint: /v2/wizardsvault/objectives #> function Get-GW2WizardsVaultObjectives { [CmdletBinding()] param ( [Parameter(Mandatory = $false)] [object]$Ids, [Parameter(Mandatory = $false)] [ValidateSet("en", "es", "de", "fr", "zh")] [string]$Lang = "en" ) $Uri = "https://api.guildwars2.com/v2/wizardsvault/objectives" if ($Ids) { $Uri += "?ids=" + ($Ids -join ",") } if ($Lang) { $Uri += "&lang=" + $Lang } try { Invoke-RestMethod -Uri $Uri -Method Get } catch { Write-Error "Failed to retrieve Wizard's Vault objectives: $_" } } |