BlizzWoWRetailGameData.psm1
# --- Importing: Get-Achievement.ps1 --- function Get-Achievement { <# .SYNOPSIS Retrieves information about a specified achievement in World of Warcraft. .DESCRIPTION The function fetches details of an achievement using the World of Warcraft API. The achievement ID is required. An optional switch is available to return the raw JSON data. .PARAMETER Id The ID of the achievement. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Achievement -Id '12345' Retrieves information about the achievement with ID 12345. .EXAMPLE Get-Achievement -Id '12345' -Raw Retrieves the raw JSON response for the achievement with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the achievement.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/achievement/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AchievementCategoriesIndex.ps1 --- function Get-AchievementCategoriesIndex { <# .SYNOPSIS Retrieves the achievement category index in World of Warcraft. .DESCRIPTION The function fetches a list of achievement categories using the World of Warcraft API. The data can be returned in a raw format if required. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AchievementCategoriesIndex Retrieves the formatted achievement category index. .EXAMPLE Get-AchievementCategoriesIndex -Raw Retrieves the raw JSON response of the achievement category index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/achievement-category/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AchievementCategory.ps1 --- function Get-AchievementCategory { <# .SYNOPSIS Retrieves the achievement category information for a given ID in World of Warcraft. .DESCRIPTION The function fetches the details of an achievement category using the World of Warcraft API. The category ID is required, and an optional switch is available to return the raw JSON response. .PARAMETER Id The unique identifier of the achievement category. This parameter is mandatory and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AchievementCategory -Id '81' Retrieves the formatted achievement category details for the given ID '81'. .EXAMPLE Get-AchievementCategory -Id '81' -Raw Retrieves the raw JSON response of the achievement category for the given ID '81'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the achievement category.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/achievement-category/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AchievementIndex.ps1 --- function Get-AchievementIndex { <# .SYNOPSIS Retrieves the achievement index in World of Warcraft. .DESCRIPTION The function fetches a list of all achievements available in World of Warcraft using the WoW API. An optional switch is available to return the raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AchievementIndex Retrieves the formatted list of achievements. .EXAMPLE Get-AchievementIndex -Raw Retrieves the raw JSON response of the achievement index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/achievement/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'achievements') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result | Select-Object -ExpandProperty achievements | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AchievementMedia.ps1 --- function Get-AchievementMedia { <# .SYNOPSIS Retrieves the media assets for a specified achievement in World of Warcraft. .DESCRIPTION The function fetches media assets for a given achievement using the World of Warcraft API. The achievement ID is required as a parameter. An optional switch is available to return the raw JSON data. .PARAMETER ID The ID of the achievement. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AchievementMedia -ID '12345' Retrieves the media assets for the achievement with the ID 12345. .EXAMPLE Get-AchievementMedia -ID '12345' -Raw Retrieves the raw JSON response for the media assets of the achievement with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the achievement.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/achievement/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AzeriteEssence.ps1 --- function Get-AzeriteEssence { <# .SYNOPSIS Retrieves the details of an Azerite Essence in World of Warcraft. .DESCRIPTION This function fetches the information for a specified Azerite Essence using the World of Warcraft API. The Azerite Essence ID is required to proceed, and the response can either be formatted or returned as raw JSON data. .PARAMETER Id The ID of the Azerite Essence to be fetched. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AzeriteEssence -Id '15' Retrieves the details of the Azerite Essence with ID 15 in a formatted output. .EXAMPLE Get-AzeriteEssence -Id '15' -Raw Retrieves the raw JSON response of the Azerite Essence with ID 15. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Azerite Essence.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/azerite-essence/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AzeriteEssenceIndex.ps1 --- function Get-AzeriteEssenceIndex { <# .SYNOPSIS Retrieves the Azerite Essences index for World of Warcraft. .DESCRIPTION The function fetches the Azerite Essences index using the World of Warcraft API. Optionally, the response can be returned in raw JSON format for more detailed information. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AzeriteEssenceIndex Retrieves the Azerite Essences index for World of Warcraft in a formatted way. .EXAMPLE Get-AzeriteEssenceIndex -Raw Retrieves the Azerite Essences index in raw JSON format. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/azerite-essence/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'azerite_essences') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty azerite_essences | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-AzeriteEssenceMedia.ps1 --- function Get-AzeriteEssenceMedia { <# .SYNOPSIS Retrieves the Azerite Essence media for a specified ID in World of Warcraft. .DESCRIPTION The function fetches media assets for a given Azerite Essence using the World of Warcraft API. The Azerite Essence ID is required as a parameter. An optional switch is available to return raw JSON data. .PARAMETER ID The Azerite Essence ID. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-AzeriteEssenceMedia -ID '7' Retrieves the media assets for the Azerite Essence with ID 7. .EXAMPLE Get-AzeriteEssenceMedia -ID '7' -Raw Retrieves the raw JSON response for the Azerite Essence with ID 7. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The Azerite Essence ID.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/azerite-essence/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Conduit.ps1 --- function Get-Conduit { <# .SYNOPSIS Retrieves the details of a specified conduit in World of Warcraft. .DESCRIPTION The function fetches details for a given conduit using the World of Warcraft API. The conduit ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the conduit. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Conduit -Id '12345' Retrieves the details for the conduit with ID 12345 in a formatted result. .EXAMPLE Get-Conduit -Id '12345' -Raw Retrieves the raw JSON response for the conduit with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the conduit.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/conduit/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ConduitIndex.ps1 --- function Get-ConduitIndex { <# .SYNOPSIS Retrieves the index of conduits available in World of Warcraft. .DESCRIPTION The function fetches a list of available conduits using the World of Warcraft API. It returns a formatted list of conduits by default or raw JSON data if specified. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ConduitIndex Retrieves the formatted list of conduits available in World of Warcraft. .EXAMPLE Get-ConduitIndex -Raw Retrieves the raw JSON response containing the conduits available in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/conduit/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'conduits') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty conduits | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ConnectedRealm.ps1 --- function Get-ConnectedRealm { <# .SYNOPSIS Retrieves information about a connected realm in World of Warcraft. .DESCRIPTION The function fetches details of a connected realm using the World of Warcraft API. The realm ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the connected realm. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ConnectedRealm -Id '1234' Retrieves the details for the connected realm with ID 1234 in a formatted output. .EXAMPLE Get-ConnectedRealm -Id '1234' -Raw Retrieves the raw JSON response for the connected realm with ID 1234. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the connected realm.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/connected-realm/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ConnectedRealmIndex.ps1 --- function Get-ConnectedRealmIndex { <# .SYNOPSIS Retrieves the index of connected realms in World of Warcraft. .DESCRIPTION This function fetches the index of connected realms available using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ConnectedRealmIndex Retrieves the index of connected realms in a formatted way. .EXAMPLE Get-ConnectedRealmIndex -Raw Retrieves the raw JSON response of the connected realms index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/connected-realm/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'connected_realms') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty connected_realms | Select-Object -ExpandProperty href } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Covenant.ps1 --- function Get-Covenant { <# .SYNOPSIS Retrieves the covenant details for a specified character in World of Warcraft. .DESCRIPTION The function fetches covenant details for a given character using the World of Warcraft API. The character ID is a required parameter, and an optional switch is available to return raw JSON data. .PARAMETER Id The covenant ID. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Covenant -Id '1' Retrieves the covenant details for the covenant with ID 1. .EXAMPLE Get-Covenant -Id '1' -Raw Retrieves the raw JSON response of the covenant details for the covenant with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the covenant.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CovenantIndex.ps1 --- function Get-CovenantIndex { <# .SYNOPSIS Retrieves the index of available covenants in World of Warcraft. .DESCRIPTION The function fetches the list of covenants available in World of Warcraft using the Blizzard API. This can provide information on all covenants including their names and IDs. The function requires the API to be accessible and valid credentials to be configured in the global variables. .PARAMETER realmSlug The slug of the realm. This is required and must not be empty. .PARAMETER characterName The name of the character. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CovenantIndex -realmSlug 'azshara' -characterName 'Strandmaus' Retrieves the index of available covenants for the character named Strandmaus on the Azshara realm. .EXAMPLE Get-CovenantIndex -realmSlug 'azshara' -characterName 'Strandmaus' -Raw Retrieves the raw JSON response for the covenant index of the character named Strandmaus on the Azshara realm. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'covenants') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty covenants | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CovenantMedia.ps1 --- function Get-CovenantMedia { <# .SYNOPSIS Retrieves the covenant media for a specified covenant in World of Warcraft. .DESCRIPTION The function fetches media data for a given covenant using the World of Warcraft API. The ID of the covenant is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER ID The ID of the covenant. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CovenantMedia -ID '1' Retrieves the formatted media data for the covenant with ID 1. .EXAMPLE Get-CovenantMedia -ID '1' -Raw Retrieves the raw JSON response for the covenant with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the covenant.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/covenant/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Creature.ps1 --- function Get-Creature { <# .SYNOPSIS Retrieves information about a specific creature in World of Warcraft. .DESCRIPTION This function fetches details about a specified creature using the World of Warcraft API. The creature ID is a required parameter, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the creature. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Creature -Id '12345' Retrieves the details for the creature with ID 12345. .EXAMPLE Get-Creature -Id '12345' -Raw Retrieves the raw JSON response for the creature with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the creature.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/creature/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureDisplayMedia.ps1 --- function Get-CreatureDisplayMedia { <# .SYNOPSIS Retrieves the media associated with a specific creature display ID in World of Warcraft. .DESCRIPTION The function fetches media assets linked to a given creature display ID using the World of Warcraft API. The creature display ID is required as a parameter. An optional switch is available to return the raw JSON response. .PARAMETER ID The display ID of the creature. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureDisplayMedia -ID '12345' Retrieves the media associated with the creature display ID 12345. .EXAMPLE Get-CreatureDisplayMedia -ID '12345' -Raw Retrieves the raw JSON response of the media associated with the creature display ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The display ID of the creature.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/creature-display/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureFamiliesIndex.ps1 --- function Get-CreatureFamiliesIndex { <# .SYNOPSIS Retrieves the index of creature families in World of Warcraft. .DESCRIPTION The function fetches a list of creature families available in World of Warcraft using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureFamiliesIndex Retrieves the formatted list of creature families. .EXAMPLE Get-CreatureFamiliesIndex -Raw Retrieves the raw JSON response of creature families. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/creature-family/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'creature_families') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty creature_families | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureFamily.ps1 --- function Get-CreatureFamily { <# .SYNOPSIS Retrieves the creature family information for a given ID in World of Warcraft. .DESCRIPTION The function fetches details of a creature family using the World of Warcraft API. A creature family ID is required. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the creature family. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureFamily -Id 1 Retrieves the creature family details for the specified ID. .EXAMPLE Get-CreatureFamily -Id 1 -Raw Retrieves the raw JSON response for the specified creature family ID. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the creature family.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/creature-family/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureFamilyMedia.ps1 --- function Get-CreatureFamilyMedia { <# .SYNOPSIS Retrieves media information for a specified creature family in World of Warcraft. .DESCRIPTION The function fetches media assets for a given creature family using the World of Warcraft API. The ID of the creature family is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER ID The ID of the creature family. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureFamilyMedia -ID '123' Retrieves the media assets for the creature family with ID 123. .EXAMPLE Get-CreatureFamilyMedia -ID '456' -Raw Retrieves the raw JSON response for the creature family with ID 456. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the creature family.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/creature-family/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureType.ps1 --- function Get-CreatureType { <# .SYNOPSIS Retrieves the creature type information for a specified ID in World of Warcraft. .DESCRIPTION This function fetches creature type details from the World of Warcraft API using the provided ID. It optionally returns the raw JSON response if the -Raw parameter is specified. .PARAMETER Id The ID of the creature type. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureType -Id '12345' Retrieves the creature type details for the creature with ID 12345. .EXAMPLE Get-CreatureType -Id '12345' -Raw Retrieves the raw JSON response for the creature type with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the creature type.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/creature-type/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-CreatureTypesIndex.ps1 --- function Get-CreatureTypesIndex { <# .SYNOPSIS Retrieves the creature types index from the World of Warcraft API. .DESCRIPTION The function fetches an index of creature types from the World of Warcraft API. The -Raw switch can be used to return the unformatted response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-CreatureTypesIndex Retrieves the formatted list of creature types from the World of Warcraft API. .EXAMPLE Get-CreatureTypesIndex -Raw Retrieves the raw JSON response of creature types from the World of Warcraft API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/creature-type/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'creature_types') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty creature_types | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-GuildCrestBorderMedia.ps1 --- function Get-GuildCrestBorderMedia { <# .SYNOPSIS Retrieves the media information for a guild crest border in World of Warcraft. .DESCRIPTION The function fetches the media data for a specified guild crest border by ID using the World of Warcraft API. The ID of the guild crest border is a required parameter. An optional switch is available to return the raw JSON data. .PARAMETER ID The ID of the guild crest border. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-GuildCrestBorderMedia -ID '5' Retrieves the media information for the guild crest border with ID 5. .EXAMPLE Get-GuildCrestBorderMedia -ID '5' -Raw Retrieves the raw JSON response for the guild crest border with ID 5. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the guild crest border.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/guild-crest/border/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-GuildCrestComponentsIndex.ps1 --- function Get-GuildCrestComponentsIndex { <# .SYNOPSIS Retrieves the guild crest components index from the World of Warcraft API. .DESCRIPTION The function fetches the guild crest components index data, which includes information on available guild emblems, borders, and colors. The optional Raw parameter can be used to return the unformatted API response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-GuildCrestComponentsIndex Retrieves the formatted guild crest components index. .EXAMPLE Get-GuildCrestComponentsIndex -Raw Retrieves the raw JSON response of the guild crest components index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/guild-crest/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-GuildCrestEmblemMedia.ps1 --- function Get-GuildCrestEmblemMedia { <# .SYNOPSIS Retrieves the media for a specified guild crest emblem in World of Warcraft. .DESCRIPTION The function fetches media details for a given guild crest emblem using the World of Warcraft API. The emblem ID is a required parameter. An optional switch is available to return the raw JSON response. .PARAMETER ID The ID of the guild crest emblem. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-GuildCrestEmblemMedia -ID '123' Retrieves the media for the guild crest emblem with ID 123. .EXAMPLE Get-GuildCrestEmblemMedia -ID '123' -Raw Retrieves the raw JSON response for the guild crest emblem with ID 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the guild crest emblem.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/guild-crest/emblem/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Heirloom.ps1 --- function Get-Heirloom { <# .SYNOPSIS Retrieves information about a specified heirloom in World of Warcraft. .DESCRIPTION This function fetches details of a given heirloom using the World of Warcraft API. The heirloom ID is required. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the heirloom. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Heirloom -Id '12345' Retrieves the information for the heirloom with ID 12345. .EXAMPLE Get-Heirloom -Id '12345' -Raw Retrieves the raw JSON response for the heirloom with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the heirloom.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/heirloom/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-HeirloomIndex.ps1 --- function Get-HeirloomIndex { <# .SYNOPSIS Retrieves the heirloom index from the World of Warcraft API. .DESCRIPTION The function fetches an index of all heirlooms available in World of Warcraft using the API. The function can return either a formatted list of heirlooms or the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-HeirloomIndex Retrieves a formatted list of all heirlooms. .EXAMPLE Get-HeirloomIndex -Raw Retrieves the raw JSON response of the heirloom index from the API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/heirloom/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'heirlooms') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty heirlooms | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-InstanceMedia.ps1 --- function Get-InstanceMedia { <# .SYNOPSIS Retrieves the media assets of a specific instance in World of Warcraft. .DESCRIPTION The function fetches media assets for a given instance ID using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER ID The ID of the instance for which to retrieve media assets. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-InstanceMedia -ID '12345' Retrieves the media assets for the instance with ID 12345. .EXAMPLE Get-InstanceMedia -ID '12345' -Raw Retrieves the raw JSON response for the media assets of the instance with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the instance for which to retrieve media assets.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/journal-instance/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Item.ps1 --- function Get-Item { <# .SYNOPSIS Retrieves the information of a specified item in World of Warcraft. .DESCRIPTION The function fetches details for a given item using the World of Warcraft API. The item ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the item. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Item -Id '19019' Retrieves the information for the item with ID 19019. .EXAMPLE Get-Item -Id '19019' -Raw Retrieves the raw JSON response of the item with ID 19019. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the item.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemAppearance.ps1 --- function Get-ItemAppearance { <# .SYNOPSIS Retrieves the appearance details of a specified item in World of Warcraft. .DESCRIPTION The function fetches the appearance details for a given item using the World of Warcraft API. The item ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the item. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemAppearance -Id '12345' Retrieves the appearance details for the item with ID 12345. .EXAMPLE Get-ItemAppearance -Id '12345' -Raw Retrieves the raw JSON response for the item appearance with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the item.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-appearance/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemAppearanceSlotIndex.ps1 --- function Get-ItemAppearanceSlotIndex { <# .SYNOPSIS Retrieves the appearance slot index for a specified item slot in World of Warcraft. .DESCRIPTION The function fetches the appearance slot index for a given item slot using the World of Warcraft API. The item slot name is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Slot The name of the item slot. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemAppearanceSlotIndex -Slot 'head' Retrieves the appearance slot index for the 'head' item slot. .EXAMPLE Get-ItemAppearanceSlotIndex -Slot 'head' -Raw Retrieves the raw JSON response for the 'head' item slot. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The item slot name.')] [ValidateNotNullOrEmpty()] [String]$Slot, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-appearance/slot/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Slot, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty appearances | Select-Object -ExpandProperty id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemAppearanceSlots.ps1 --- function Get-ItemAppearanceSlots { <# .SYNOPSIS Retrieves item appearance slots available in World of Warcraft. .DESCRIPTION The function fetches a list of item appearance slots using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemAppearanceSlots Retrieves a formatted list of item appearance slots. .EXAMPLE Get-ItemAppearanceSlots -Raw Retrieves the raw JSON response of item appearance slots. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-appearance/slot/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' $SlotURLs = $result | Select-Object -ExpandProperty slots | Select-Object -ExpandProperty key | Select-Object -ExpandProperty href $pattern = '/([^/?]+)\?' foreach($SlotURL in $SlotURLs) { if($SlotURL -match $pattern) { $matches[1] } } } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemClass.ps1 --- function Get-ItemClass { <# .SYNOPSIS Retrieves the item class details for a specified ID in World of Warcraft. .DESCRIPTION The function fetches the item class details for a given item class ID using the World of Warcraft API. The item class ID is a mandatory parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the item class to be retrieved. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemClass -Id '2' Retrieves the details for the item class with ID 2. .EXAMPLE Get-ItemClass -Id '2' -Raw Retrieves the raw JSON response for the item class with ID 2. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the item class to be retrieved.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-class/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemClassIndex.ps1 --- function Get-ItemClassIndex { <# .SYNOPSIS Retrieves the item class index from the World of Warcraft API. .DESCRIPTION This function retrieves the item class index using the World of Warcraft API. The response can be formatted or returned as raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemClassIndex Retrieves a formatted list of item classes from the World of Warcraft API. .EXAMPLE Get-ItemClassIndex -Raw Retrieves the raw JSON response of item classes from the World of Warcraft API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-class/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'item_classes') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty item_classes | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemMedia.ps1 --- function Get-ItemMedia { <# .SYNOPSIS Retrieves the media asset details of a specified item in World of Warcraft. .DESCRIPTION The function fetches media information for a given item using the World of Warcraft API. The item ID is a required parameter, and an optional switch is available to return the raw JSON data from the API. .PARAMETER ID The ID of the item. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemMedia -ID '19019' Retrieves the media asset details for the item with ID 19019. .EXAMPLE Get-ItemMedia -ID '19019' -Raw Retrieves the raw JSON response of the media details for the item with ID 19019. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the item.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/item/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemSet.ps1 --- function Get-ItemSet { <# .SYNOPSIS Retrieves details of an item set by its ID in World of Warcraft. .DESCRIPTION The function fetches details of an item set based on the provided ID using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the item set. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemSet -Id '12345' Retrieves the formatted details for the item set with ID 12345. .EXAMPLE Get-ItemSet -Id '12345' -Raw Retrieves the raw JSON response for the item set with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the item set.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-set/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemSetAppearance.ps1 --- function Get-ItemSetAppearance { <# .SYNOPSIS Retrieves the appearance details of a specified item set in World of Warcraft. .DESCRIPTION The function fetches detailed appearance information for a given item set using the World of Warcraft API. The item set ID is required, and an optional switch is available to return raw JSON data. .PARAMETER Id The unique identifier for the item set. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemSetAppearance -Id '12345' Retrieves the formatted appearance details for the item set with ID 12345. .EXAMPLE Get-ItemSetAppearance -Id '12345' -Raw Retrieves the raw JSON response for the item set appearance with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier for the item set.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-appearance/set/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemSetAppearanceIndex.ps1 --- function Get-ItemSetAppearanceIndex { <# .SYNOPSIS Retrieves the item set appearance index in World of Warcraft. .DESCRIPTION The function fetches a list of item set appearances using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemSetAppearanceIndex Retrieves the formatted list of item set appearances. .EXAMPLE Get-ItemSetAppearanceIndex -Raw Retrieves the raw JSON response of item set appearances. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-appearance/set/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'appearance_sets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty appearance_sets | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ItemSetsIndex.ps1 --- function Get-ItemSetsIndex { <# .SYNOPSIS Retrieves the item sets index from World of Warcraft API. .DESCRIPTION The function fetches a list of item sets available in World of Warcraft using the API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ItemSetsIndex Retrieves a formatted list of item sets. .EXAMPLE Get-ItemSetsIndex -Raw Retrieves the raw JSON response of the item sets index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/item-set/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'item_sets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty item_sets | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalEncounter.ps1 --- function Get-JournalEncounter { <# .SYNOPSIS Retrieves details of a journal encounter in World of Warcraft. .DESCRIPTION The function fetches information about a specific journal encounter using the World of Warcraft API. The encounter ID is required to retrieve data, and there is an optional switch to return the raw JSON data. .PARAMETER Id The ID of the journal encounter. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalEncounter -Id '200' Retrieves details for the journal encounter with ID 200 in a formatted result. .EXAMPLE Get-JournalEncounter -Id '200' -Raw Retrieves the raw JSON response for the journal encounter with ID 200. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the journal encounter.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-encounter/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } if($result.PSObject.Properties['character']) { $result.PSObject.Properties.Remove('character') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalEncounterIndex.ps1 --- function Get-JournalEncounterIndex { <# .SYNOPSIS Retrieves the list of journal encounters available in World of Warcraft. .DESCRIPTION This function fetches the index of journal encounters using the World of Warcraft API. It returns a formatted list by default or raw JSON data if specified by the -Raw parameter. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalEncounterIndex Retrieves the journal encounters in a formatted list. .EXAMPLE Get-JournalEncounterIndex -Raw Retrieves the raw JSON response for journal encounters. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-encounter/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'encounters') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty encounters | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalExpansion.ps1 --- function Get-JournalExpansion { <# .SYNOPSIS Retrieves information about a journal expansion in World of Warcraft. .DESCRIPTION The function fetches detailed information about a specified journal expansion using the World of Warcraft API. The expansion ID is required as a parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the journal expansion. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalExpansion -Id '68' Retrieves information about the journal expansion with ID 68 in World of Warcraft. .EXAMPLE Get-JournalExpansion -Id '68' -Raw Retrieves the raw JSON response for the journal expansion with ID 68 in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the journal expansion.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-expansion/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalExpansionIndex.ps1 --- function Get-JournalExpansionIndex { <# .SYNOPSIS Retrieves the journal expansion index from World of Warcraft. .DESCRIPTION The function fetches a list of expansions from the World of Warcraft journal using the Blizzard API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalExpansionIndex Retrieves the formatted journal expansion index. .EXAMPLE Get-JournalExpansionIndex -Raw Retrieves the raw JSON response of the journal expansion index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-expansion/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'tiers') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty tiers | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalInstance.ps1 --- function Get-JournalInstance { <# .SYNOPSIS Retrieves a specific journal instance in World of Warcraft by its ID. .DESCRIPTION The function fetches a journal instance from World of Warcraft using the Blizzard API. The journal instance is identified by a provided ID. Optionally, you can retrieve the raw JSON data by using the -Raw parameter. .PARAMETER Id The ID of the journal instance. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalInstance -Id '144' Retrieves the journal instance with ID 144 in a formatted manner. .EXAMPLE Get-JournalInstance -Id '144' -Raw Retrieves the raw JSON response for the journal instance with ID 144. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the journal instance.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-instance/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-JournalInstanceIndex.ps1 --- function Get-JournalInstanceIndex { <# .SYNOPSIS Retrieves the journal instance index from World of Warcraft. .DESCRIPTION This function fetches the journal instance index from the World of Warcraft API. It provides the option to return a raw JSON response or a formatted list of instances. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-JournalInstanceIndex Retrieves a formatted list of journal instances from World of Warcraft. .EXAMPLE Get-JournalInstanceIndex -Raw Retrieves the raw JSON response of journal instances from World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param ( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/journal-instance/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'instances') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty instances | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ModifiedCraftingCategory.ps1 --- function Get-ModifiedCraftingCategory { <# .SYNOPSIS Retrieves the modified crafting category information in World of Warcraft. .DESCRIPTION This function fetches detailed information about a specified modified crafting category using the World of Warcraft API. The function requires a category ID to identify the specific crafting category. An optional switch is available to return the raw JSON response. .PARAMETER Id The ID of the modified crafting category. This parameter is mandatory and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ModifiedCraftingCategory -Id '123' Retrieves the modified crafting category with the ID 123. .EXAMPLE Get-ModifiedCraftingCategory -Id '123' -Raw Retrieves the raw JSON response for the modified crafting category with the ID 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the modified crafting category.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/modified-crafting/category/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ModifiedCraftingCategoryIndex.ps1 --- function Get-ModifiedCraftingCategoryIndex { <# .SYNOPSIS Retrieves the modified crafting categories index from World of Warcraft. .DESCRIPTION The function fetches the modified crafting categories index using the World of Warcraft API. This information includes all available modified crafting categories. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ModifiedCraftingCategoryIndex Retrieves the modified crafting categories index in a formatted way. .EXAMPLE Get-ModifiedCraftingCategoryIndex -Raw Retrieves the raw JSON response of the modified crafting categories index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/modified-crafting/category/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'categories') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty categories | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ModifiedCraftingReagentSlotType.ps1 --- function Get-ModifiedCraftingReagentSlotType { <# .SYNOPSIS Retrieves information about a modified crafting reagent slot type in World of Warcraft. .DESCRIPTION The function fetches information about a specified modified crafting reagent slot type using the World of Warcraft API. The ID is required as a parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The unique identifier for the crafting reagent slot type. This parameter is mandatory. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ModifiedCraftingReagentSlotType -Id '12345' Retrieves the formatted information for the modified crafting reagent slot type with ID '12345'. .EXAMPLE Get-ModifiedCraftingReagentSlotType -Id '12345' -Raw Retrieves the raw JSON response for the modified crafting reagent slot type with ID '12345'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier for the crafting reagent slot type.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/modified-crafting/reagent-slot-type/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ModifiedCraftingReagentSlotTypeIndex.ps1 --- function Get-ModifiedCraftingReagentSlotTypeIndex { <# .SYNOPSIS Retrieves the modified crafting reagent slot types in World of Warcraft. .DESCRIPTION The function fetches the modified crafting reagent slot types using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ModifiedCraftingReagentSlotTypeIndex Retrieves the modified crafting reagent slot types in a formatted manner. .EXAMPLE Get-ModifiedCraftingReagentSlotTypeIndex -Raw Retrieves the raw JSON response of the modified crafting reagent slot types. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/modified-crafting/reagent-slot-type/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'slot_types') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty slot_types | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Mount.ps1 --- function Get-Mount { <# .SYNOPSIS Retrieves mount information from World of Warcraft based on the specified mount ID. .DESCRIPTION The function fetches detailed information about a specific mount using the World of Warcraft API. The mount ID is required as input. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the mount. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Mount -Id '100' Retrieves the mount information for the mount with ID 100. .EXAMPLE Get-Mount -Id '100' -Raw Retrieves the raw JSON response of the mount information for the mount with ID 100. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the mount.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mount/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MountIndex.ps1 --- function Get-MountIndex { <# .SYNOPSIS Retrieves the mount index from the World of Warcraft API. .DESCRIPTION This function fetches a list of all available mounts using the World of Warcraft API. The function can return a formatted list or raw JSON data based on the provided parameter. .PARAMETER Raw Optional switch to return the raw JSON response from the API instead of a formatted result. .EXAMPLE Get-MountIndex Retrieves a formatted list of all available mounts, sorted by ID. .EXAMPLE Get-MountIndex -Raw Retrieves the raw JSON response containing the mount index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mount/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'mounts') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty mounts | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneAffix.ps1 --- function Get-MythicKeystoneAffix { <# .SYNOPSIS Retrieves the information of a specified Mythic Keystone affix in World of Warcraft. .DESCRIPTION The function fetches details about a specific Mythic Keystone affix using the World of Warcraft API. The ID of the affix is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the Mythic Keystone affix. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneAffix -Id '10' Retrieves the details for the Mythic Keystone affix with the ID 10. .EXAMPLE Get-MythicKeystoneAffix -Id '10' -Raw Retrieves the raw JSON response of the Mythic Keystone affix with the ID 10. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Mythic Keystone affix.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/keystone-affix/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneAffixIndex.ps1 --- function Get-MythicKeystoneAffixIndex { <# .SYNOPSIS Retrieves the index of available Mythic Keystone affixes in World of Warcraft. .DESCRIPTION The function fetches the index of available Mythic Keystone affixes using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneAffixIndex Retrieves the list of available Mythic Keystone affixes in a formatted result. .EXAMPLE Get-MythicKeystoneAffixIndex -Raw Retrieves the raw JSON response of available Mythic Keystone affixes. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/keystone-affix/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'affixes') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty affixes | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneAffixMedia.ps1 --- function Get-MythicKeystoneAffixMedia { <# .SYNOPSIS Retrieves media information for a specified Mythic Keystone affix in World of Warcraft. .DESCRIPTION The function fetches media data for a given Mythic Keystone affix using the World of Warcraft API. The affix ID is required, and an optional switch is available to return raw JSON data. .PARAMETER ID The ID of the Mythic Keystone affix. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneAffixMedia -ID '123' Retrieves the media information for the Mythic Keystone affix with ID 123. .EXAMPLE Get-MythicKeystoneAffixMedia -ID '123' -Raw Retrieves the raw JSON response for the media information of the Mythic Keystone affix with ID 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Mythic Keystone affix.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/keystone-affix/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneDungeon.ps1 --- function Get-MythicKeystoneDungeon { <# .SYNOPSIS Retrieves the details of a specified Mythic Keystone Dungeon in World of Warcraft. .DESCRIPTION The function fetches the details of a specific Mythic Keystone Dungeon using the World of Warcraft API. An ID is required to specify the dungeon, and an optional switch can be used to return raw JSON data. .PARAMETER Id The ID of the Mythic Keystone Dungeon. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneDungeon -Id '1' Retrieves the details of the Mythic Keystone Dungeon with ID 1. .EXAMPLE Get-MythicKeystoneDungeon -Id '1' -Raw Retrieves the raw JSON response for the Mythic Keystone Dungeon with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Mythic Keystone Dungeon.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/dungeon/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneDungeonIndex.ps1 --- function Get-MythicKeystoneDungeonIndex { <# .SYNOPSIS Retrieves the index of Mythic Keystone dungeons in World of Warcraft. .DESCRIPTION The function fetches an index of Mythic Keystone dungeons using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneDungeonIndex Retrieves the index of Mythic Keystone dungeons and returns a formatted list. .EXAMPLE Get-MythicKeystoneDungeonIndex -Raw Retrieves the raw JSON response of Mythic Keystone dungeons. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/dungeon/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'dungeons') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty dungeons | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystonePeriod.ps1 --- function Get-MythicKeystonePeriod { <# .SYNOPSIS Retrieves the details of a specific Mythic Keystone period in World of Warcraft. .DESCRIPTION This function fetches information about a given Mythic Keystone period using the World of Warcraft API. The period ID is a required parameter. An optional switch is available to return raw JSON data instead of a formatted response. .PARAMETER Id The ID of the Mythic Keystone period. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystonePeriod -Id '678' Retrieves the details of Mythic Keystone period with ID 678. .EXAMPLE Get-MythicKeystonePeriod -Id '678' -Raw Retrieves the raw JSON response of Mythic Keystone period with ID 678. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Mythic Keystone period.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/period/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystonePeriodIndex.ps1 --- function Get-MythicKeystonePeriodIndex { <# .SYNOPSIS Retrieves the current Mythic Keystone period index in World of Warcraft. .DESCRIPTION The function fetches the current Mythic Keystone period index using the World of Warcraft API. This function does not require any realm or character-specific information. An optional switch is available to return the raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystonePeriodIndex Retrieves the current Mythic Keystone period index in a formatted way. .EXAMPLE Get-MythicKeystonePeriodIndex -Raw Retrieves the raw JSON response for the current Mythic Keystone period index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/period/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneSeason.ps1 --- function Get-MythicKeystoneSeason { <# .SYNOPSIS Retrieves information about a specific Mythic Keystone season in World of Warcraft. .DESCRIPTION This function fetches data for a given Mythic Keystone season using the World of Warcraft API. It requires a valid season ID and optionally returns the raw JSON response if the -Raw switch is provided. .PARAMETER Id The ID of the Mythic Keystone season. This parameter is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneSeason -Id '1' Retrieves information about Mythic Keystone season 1. .EXAMPLE Get-MythicKeystoneSeason -Id '1' -Raw Retrieves the raw JSON response for Mythic Keystone season 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the Mythic Keystone season.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/season/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-MythicKeystoneSeasonIndex.ps1 --- function Get-MythicKeystoneSeasonIndex { <# .SYNOPSIS Retrieves the Mythic Keystone season index for World of Warcraft. .DESCRIPTION This function fetches the Mythic Keystone season index using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-MythicKeystoneSeasonIndex Retrieves the Mythic Keystone season index for the current World of Warcraft region. .EXAMPLE Get-MythicKeystoneSeasonIndex -Raw Retrieves the raw JSON response of the Mythic Keystone season index for the current World of Warcraft region. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/mythic-keystone/season/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Pet.ps1 --- function Get-Pet { <# .SYNOPSIS Retrieves information about a specific pet in World of Warcraft. .DESCRIPTION This function fetches detailed information about a pet using the World of Warcraft API. The pet ID must be provided as a parameter. An optional switch is available to return the raw JSON response. .PARAMETER Id The unique identifier of the pet. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Pet -Id '39' Retrieves information about the pet with ID 39. .EXAMPLE Get-Pet -Id '39' -Raw Retrieves the raw JSON response for the pet with ID 39. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier of the pet.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pet/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PetAbility.ps1 --- function Get-PetAbility { <# .SYNOPSIS Retrieves information about a specific pet ability in World of Warcraft. .DESCRIPTION The function fetches detailed information for a pet ability based on the given ability ID using the World of Warcraft API. The optional -Raw parameter can be used to return the raw JSON response. .PARAMETER Id The ID of the pet ability. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PetAbility -Id '640' Retrieves the formatted details of the pet ability with ID 640. .EXAMPLE Get-PetAbility -Id '640' -Raw Retrieves the raw JSON response for the pet ability with ID 640. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the pet ability.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pet-ability/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PetAbilityIndex.ps1 --- function Get-PetAbilityIndex { <# .SYNOPSIS Retrieves the index of pet abilities in World of Warcraft. .DESCRIPTION The function fetches a list of all available pet abilities from the World of Warcraft API. It requires an active API connection and valid credentials set in the global variables. The output can be formatted or returned in raw JSON format depending on the user's choice. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PetAbilityIndex Retrieves a formatted list of all pet abilities in World of Warcraft. .EXAMPLE Get-PetAbilityIndex -Raw Retrieves the raw JSON response of all pet abilities in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pet-ability/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'abilities') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty abilities | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PetAbilityMedia.ps1 --- function Get-PetAbilityMedia { <# .SYNOPSIS Retrieves media assets related to a pet ability in World of Warcraft. .DESCRIPTION The function fetches media information for a given pet ability using the World of Warcraft API. The pet ability ID is required. An optional switch is available to return the raw JSON data. .PARAMETER ID The ID of the pet ability. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PetAbilityMedia -ID '12345' Retrieves the media assets for the pet ability with ID 12345. .EXAMPLE Get-PetAbilityMedia -ID '12345' -Raw Retrieves the raw JSON response for the pet ability with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the pet ability.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/pet-ability/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PetIndex.ps1 --- function Get-PetIndex { <# .SYNOPSIS Retrieves the index of battle pets available in World of Warcraft. .DESCRIPTION The function fetches a list of all battle pets available in the World of Warcraft game using the Blizzard API. If the -Raw switch is specified, it returns the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PetIndex Retrieves a formatted list of all battle pets available in the game. .EXAMPLE Get-PetIndex -Raw Retrieves the raw JSON response of all battle pets available in the game. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pet/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'pets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty pets | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PetMedia.ps1 --- function Get-PetMedia { <# .SYNOPSIS Retrieves media information for a specified pet in World of Warcraft. .DESCRIPTION This function fetches the media assets for a given pet ID from the World of Warcraft API. The pet ID is required and must not be empty. An optional switch is available to return raw JSON data. .PARAMETER ID The ID of the pet. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PetMedia -ID '123' Retrieves the media assets for the pet with ID 123. .EXAMPLE Get-PetMedia -ID '456' -Raw Retrieves the raw JSON response for the pet with ID 456. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the pet.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/pet/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableClass.ps1 --- function Get-PlayableClass { <# .SYNOPSIS Retrieves the details of a specified playable class in World of Warcraft. .DESCRIPTION The function fetches the details of a playable class using the World of Warcraft API. The class ID is required. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the playable class. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableClass -Id '7' Retrieves the details of the playable class with ID 7. .EXAMPLE Get-PlayableClass -Id '7' -Raw Retrieves the raw JSON response of the playable class with ID 7. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable class.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-class/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableClassIndex.ps1 --- function Get-PlayableClassIndex { <# .SYNOPSIS Retrieves the index of playable classes in World of Warcraft. .DESCRIPTION The function fetches the list of playable classes available in World of Warcraft using the Blizzard API. The list can be returned in a raw JSON format if the optional -Raw parameter is used. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableClassIndex Retrieves the index of playable classes in a formatted way. .EXAMPLE Get-PlayableClassIndex -Raw Retrieves the raw JSON response of playable classes. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-class/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'classes') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty classes | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableClassMedia.ps1 --- function Get-PlayableClassMedia { <# .SYNOPSIS Retrieves media assets for a specified playable class in World of Warcraft. .DESCRIPTION The function fetches media assets, such as images, for a given playable class using the World of Warcraft API. The class ID is required, and an optional switch is available to return the raw JSON response. .PARAMETER ID The ID of the playable class. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableClassMedia -ID '1' Retrieves the media assets for the playable class with ID 1. .EXAMPLE Get-PlayableClassMedia -ID '1' -Raw Retrieves the raw JSON response of media assets for the playable class with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable class.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/playable-class/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableRace.ps1 --- function Get-PlayableRace { <# .SYNOPSIS Retrieves information about a playable race in World of Warcraft. .DESCRIPTION The function fetches data for a specific playable race using the World of Warcraft API. The race ID is required as a parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the playable race. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableRace -Id '1' Retrieves formatted information about the playable race with ID 1. .EXAMPLE Get-PlayableRace -Id '1' -Raw Retrieves the raw JSON response for the playable race with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param ( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable race.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-race/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableRaceIndex.ps1 --- function Get-PlayableRaceIndex { <# .SYNOPSIS Retrieves a list of playable races in World of Warcraft. .DESCRIPTION This function fetches an index of playable races using the World of Warcraft API. The information is retrieved for the specified region and localization settings as configured globally. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableRaceIndex Retrieves a formatted list of playable races in World of Warcraft. .EXAMPLE Get-PlayableRaceIndex -Raw Retrieves the raw JSON response of playable races in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-race/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'races') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty races | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableSpecialization.ps1 --- function Get-PlayableSpecialization { <# .SYNOPSIS Retrieves the details of a specified playable specialization in World of Warcraft. .DESCRIPTION The function fetches detailed information about a given playable specialization using the World of Warcraft API. The specialization ID is required, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the playable specialization. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableSpecialization -Id '262' Retrieves the formatted details of the specialization with the ID 262. .EXAMPLE Get-PlayableSpecialization -Id '262' -Raw Retrieves the raw JSON response of the specialization with the ID 262. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable specialization.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-specialization/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableSpecializationIndex.ps1 --- function Get-PlayableSpecializationIndex { <# .SYNOPSIS Retrieves the index of playable specializations in World of Warcraft. .DESCRIPTION The function fetches a list of playable specializations using the World of Warcraft API. An optional switch is available to return the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableSpecializationIndex Retrieves the formatted list of playable specializations in World of Warcraft. .EXAMPLE Get-PlayableSpecializationIndex -Raw Retrieves the raw JSON response for the index of playable specializations in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-specialization/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PlayableSpecializationMedia.ps1 --- function Get-PlayableSpecializationMedia { <# .SYNOPSIS Retrieves the media assets of a specified playable specialization in World of Warcraft. .DESCRIPTION The function fetches media information for a given playable specialization using the World of Warcraft API. The specialization ID is required. An optional switch is available to return the raw JSON response. .PARAMETER ID The ID of the playable specialization. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PlayableSpecializationMedia -ID '263' Retrieves the media assets for the playable specialization with ID 263. .EXAMPLE Get-PlayableSpecializationMedia -ID '263' -Raw Retrieves the raw JSON response of the media assets for the playable specialization with ID 263. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable specialization.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/playable-specialization/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PowerType.ps1 --- function Get-PowerType { <# .SYNOPSIS Retrieves the power type information in World of Warcraft. .DESCRIPTION The function fetches power type details for a specified ID using the World of Warcraft API. The power type ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the power type. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PowerType -Id '1' Retrieves the power type information for the specified ID. .EXAMPLE Get-PowerType -Id '1' -Raw Retrieves the raw JSON response of the power type information for the specified ID. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the power type.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/power-type/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PowerTypeIndex.ps1 --- function Get-PowerTypeIndex { <# .SYNOPSIS Retrieves the available power types in World of Warcraft. .DESCRIPTION The function fetches a list of available power types using the World of Warcraft API. The API connection must be accessible for the request to succeed. An optional switch parameter is provided to return the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PowerTypeIndex Retrieves the available power types in a formatted output. .EXAMPLE Get-PowerTypeIndex -Raw Retrieves the raw JSON response of available power types. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/power-type/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'power_types') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty power_types | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Profession.ps1 --- function Get-Profession { <# .SYNOPSIS Retrieves details of a specified profession in World of Warcraft. .DESCRIPTION The function fetches details of a given profession using the World of Warcraft API. The profession ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the profession. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Profession -Id '164' Retrieves the formatted details of the profession with the ID 164. .EXAMPLE Get-Profession -Id '164' -Raw Retrieves the raw JSON response of the profession with the ID 164. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the profession.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/profession/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ProfessionIndex.ps1 --- function Get-ProfessionIndex { <# .SYNOPSIS Retrieves the list of professions available in World of Warcraft. .DESCRIPTION The function fetches a list of professions using the World of Warcraft API. This allows for obtaining an indexed list of all available professions in the game. An optional switch can be used to return the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ProfessionIndex Retrieves a formatted list of all available professions. .EXAMPLE Get-ProfessionIndex -Raw Retrieves the raw JSON response of all available professions. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/profession/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'professions') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty professions | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ProfessionMedia.ps1 --- function Get-ProfessionMedia { <# .SYNOPSIS Retrieves media assets for a specified profession in World of Warcraft. .DESCRIPTION The function fetches media assets for a given profession using the World of Warcraft API. The profession ID is required, and an optional switch is available to return raw JSON data. .PARAMETER ID The ID of the profession. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ProfessionMedia -ID '164' Retrieves the media assets for the profession with ID 164. .EXAMPLE Get-ProfessionMedia -ID '164' -Raw Retrieves the raw JSON response for the profession with ID 164. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the profession.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/profession/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ProfessionSkillTier.ps1 --- function Get-ProfessionSkillTier { <# .SYNOPSIS Retrieves the skill tier information of a specified profession in World of Warcraft. .DESCRIPTION The function fetches the skill tier details for a given profession using the World of Warcraft API. The ProfessionID and SkillTierID are required parameters. An optional switch is available to return raw JSON data. .PARAMETER ProfessionID The ID of the profession. This is required and must not be empty. .PARAMETER SkillTierID The ID of the skill tier. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ProfessionSkillTier -ProfessionID '164' -SkillTierID '2751' Retrieves the skill tier information for profession ID 164 and skill tier ID 2751. .EXAMPLE Get-ProfessionSkillTier -ProfessionID '164' -SkillTierID '2751' -Raw Retrieves the raw JSON response of the skill tier information for profession ID 164 and skill tier ID 2751. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the profession.')] [ValidateNotNullOrEmpty()] [String]$ProfessionID, [Parameter(Mandatory, Position = 1, HelpMessage = 'The ID of the skill tier.')] [ValidateNotNullOrEmpty()] [String]$SkillTierID, [Parameter(Position = 2, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/profession/{1}/skill-tier/{2}?namespace=static-{3}&locale={4}' -f $Global:WoWBaseURL, $ProfessionID, $SkillTierID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPSeason.ps1 --- function Get-PvPSeason { <# .SYNOPSIS Retrieves details about a specific PvP season in World of Warcraft. .DESCRIPTION The function fetches information about a specified PvP season using the World of Warcraft API. The season ID is required, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the PvP season. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPSeason -Id '30' Retrieves the details of PvP season with ID 30. .EXAMPLE Get-PvPSeason -Id '30' -Raw Retrieves the raw JSON response for PvP season with ID 30. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the PvP season.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-season/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPSeasonIndex.ps1 --- function Get-PvPSeasonsIndex { <# .SYNOPSIS Retrieves the PvP seasons index for World of Warcraft. .DESCRIPTION The function fetches the PvP seasons index using the World of Warcraft API. An optional switch is available to return the raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPSeasonsIndex Retrieves the formatted PvP seasons index. .EXAMPLE Get-PvPSeasonsIndex -Raw Retrieves the raw JSON response of the PvP seasons index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-season/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTalent.ps1 --- function Get-PvPTalent { <# .SYNOPSIS Retrieves information about a specified PvP talent in World of Warcraft. .DESCRIPTION The function fetches details of a PvP talent based on the provided ID using the World of Warcraft API. The optional switch parameter allows for returning the raw JSON response. .PARAMETER Id The ID of the PvP talent to retrieve. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTalent -Id '12345' Retrieves information about the PvP talent with the ID 12345. .EXAMPLE Get-PvPTalent -Id '12345' -Raw Retrieves the raw JSON response of the PvP talent with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the PvP talent.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-talent/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTalentIndex.ps1 --- function Get-PvPTalentIndex { <# .SYNOPSIS Retrieves the PvP talent index from the World of Warcraft API. .DESCRIPTION This function fetches the PvP talent index for World of Warcraft using the specified API endpoint. It can return the formatted data or the raw JSON response. The WoW API credentials must be set globally. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTalentIndex Retrieves the formatted PvP talent index. .EXAMPLE Get-PvPTalentIndex -Raw Retrieves the raw JSON response of the PvP talent index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-talent/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'pvp_talents') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty pvp_talents | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTalentSlots.ps1 --- function Get-PvPTalentSlots { <# .SYNOPSIS Retrieves the PvP talent slots of a specified playable class in World of Warcraft. .DESCRIPTION The function fetches the PvP talent slots for a given class using the World of Warcraft API. The class ID is a required parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the playable class. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTalentSlots -Id '1' Retrieves the PvP talent slots for the class with ID 1. .EXAMPLE Get-PvPTalentSlots -Id '1' -Raw Retrieves the raw JSON response of PvP talent slots for the class with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the playable class.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/playable-class/{1}/pvp-talent-slots?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'talent_slots') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty talent_slots } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTier.ps1 --- function Get-PvPTier { <# .SYNOPSIS Retrieves the PvP tier information of a specified ID in World of Warcraft. .DESCRIPTION The function fetches the PvP tier information for a given ID using the World of Warcraft API. The ID is a mandatory parameter, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the PvP tier. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTier -Id '1' Retrieves the PvP tier information for the ID '1'. .EXAMPLE Get-PvPTier -Id '1' -Raw Retrieves the raw JSON response of the PvP tier information for the ID '1'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the PvP tier.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-tier/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTierIndex.ps1 --- function Get-PvPTierIndex { <# .SYNOPSIS Retrieves the PvP tier index information from World of Warcraft. .DESCRIPTION The function fetches a list of PvP tiers using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTierIndex Retrieves the list of PvP tiers in a formatted way. .EXAMPLE Get-PvPTierIndex -Raw Retrieves the raw JSON response of the PvP tier index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/pvp-tier/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'tiers') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty tiers | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-PvPTierMedia.ps1 --- function Get-PvPTierMedia { <# .SYNOPSIS Retrieves media assets for a specific PvP tier in World of Warcraft. .DESCRIPTION The function fetches media information for a given PvP tier by its ID using the World of Warcraft API. It supports returning either a formatted response or the raw JSON response. .PARAMETER ID The ID of the PvP tier. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-PvPTierMedia -ID '123' Retrieves the media information for the PvP tier with ID 123. .EXAMPLE Get-PvPTierMedia -ID '123' -Raw Retrieves the raw JSON response for the PvP tier with ID 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the PvP tier.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/pvp-tier/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Quest.ps1 --- function Get-Quest { <# .SYNOPSIS Retrieves the details of a specified quest in World of Warcraft. .DESCRIPTION The function fetches information about a quest using the World of Warcraft API. The quest ID is required as a parameter. An optional switch is available to return the raw JSON response. .PARAMETER Id The ID of the quest. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Quest -Id '12345' Retrieves the formatted details of the quest with the ID 12345. .EXAMPLE Get-Quest -Id '12345' -Raw Retrieves the raw JSON response of the quest with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the quest.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestArea.ps1 --- function Get-QuestArea { <# .SYNOPSIS Retrieves information about a specified quest area in World of Warcraft. .DESCRIPTION The function fetches details about a quest area based on the given ID using the World of Warcraft API. The quest area ID is required, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the quest area. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestArea -Id '12345' Retrieves the formatted details of the quest area with ID 12345. .EXAMPLE Get-QuestArea -Id '12345' -Raw Retrieves the raw JSON response for the quest area with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the quest area.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/area/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestAreaIndex.ps1 --- function Get-QuestAreaIndex { <# .SYNOPSIS Retrieves the index of quest areas in World of Warcraft. .DESCRIPTION The function fetches a list of quest areas using the World of Warcraft API. This can be useful for understanding the areas where quests are available within the game. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestAreaIndex Retrieves the formatted list of quest areas available in World of Warcraft. .EXAMPLE Get-QuestAreaIndex -Raw Retrieves the raw JSON response containing the quest areas in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/area/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'areas') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty areas | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestCategory.ps1 --- function Get-QuestCategory { <# .SYNOPSIS Retrieves information about a specific quest category in World of Warcraft. .DESCRIPTION The function fetches detailed information for a given quest category using the World of Warcraft API. The ID of the quest category is a mandatory parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the quest category. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestCategory -Id '1234' Retrieves formatted details for the quest category with ID 1234. .EXAMPLE Get-QuestCategory -Id '1234' -Raw Retrieves the raw JSON response for the quest category with ID 1234. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the quest category.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/category/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestCategoryIndex.ps1 --- function Get-QuestCategoryIndex { <# .SYNOPSIS Retrieves the quest category index in World of Warcraft. .DESCRIPTION The function fetches a list of all quest categories available using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestCategoryIndex Retrieves a formatted list of all quest categories available in World of Warcraft. .EXAMPLE Get-QuestCategoryIndex -Raw Retrieves the raw JSON response of the quest category index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/category/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'categories') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty categories | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestType.ps1 --- function Get-QuestType { <# .SYNOPSIS Retrieves the type of a specified quest in World of Warcraft. .DESCRIPTION The function fetches the quest type for a given quest ID using the World of Warcraft API. The quest ID is a mandatory parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the quest. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestType -Id '12345' Retrieves the formatted type of the quest with ID 12345. .EXAMPLE Get-QuestType -Id '12345' -Raw Retrieves the raw JSON response for the quest type with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the quest.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/type/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-QuestTypeIndex.ps1 --- function Get-QuestTypeIndex { <# .SYNOPSIS Retrieves the list of quest types available in World of Warcraft. .DESCRIPTION The function fetches the available quest types using the World of Warcraft API. An optional switch can be used to return the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-QuestTypeIndex Retrieves the list of quest types in a formatted manner. .EXAMPLE Get-QuestTypeIndex -Raw Retrieves the raw JSON response of quest types from the World of Warcraft API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/quest/type/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'types') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty types | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Realm.ps1 --- function Get-Realm { <# .SYNOPSIS Retrieves information about a specified realm in World of Warcraft. .DESCRIPTION The function fetches information about a given realm using the World of Warcraft API. The realm slug is a required parameter, and an optional switch is available to return raw JSON data. .PARAMETER realmSlug The slug of the realm. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Realm -realmSlug 'azshara' Retrieves the information for the realm named Azshara. .EXAMPLE Get-Realm -realmSlug 'azshara' -Raw Retrieves the raw JSON response for the realm named Azshara. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param ( [Parameter(Mandatory, Position = 0, HelpMessage = 'The slug of the realm.')] [ValidateNotNullOrEmpty()] [String]$realmSlug, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/realm/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $realmSlug, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-RealmIndex.ps1 --- function Get-RealmIndex { <# .SYNOPSIS Retrieves a list of available realms in World of Warcraft. .DESCRIPTION The function fetches a list of available realms using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-RealmIndex Retrieves a formatted list of available realms, sorted by ID. .EXAMPLE Get-RealmIndex -Raw Retrieves the raw JSON response containing the list of available realms. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/realm/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'realms') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty realms | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Recipe.ps1 --- function Get-Recipe { <# .SYNOPSIS Retrieves the details of a specified recipe in World of Warcraft. .DESCRIPTION The function fetches information about a specific recipe using the World of Warcraft API. The recipe ID is required. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the recipe. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Recipe -Id '42' Retrieves the details for the recipe with ID 42. .EXAMPLE Get-Recipe -Id '42' -Raw Retrieves the raw JSON response of the recipe with ID 42. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the recipe.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/recipe/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-RecipeMedia.ps1 --- function Get-RecipeMedia { <# .SYNOPSIS Retrieves media information for a specified recipe in World of Warcraft. .DESCRIPTION The function fetches media details for a given recipe using the World of Warcraft API. The recipe ID is required and must not be empty. An optional switch is available to return raw JSON data. .PARAMETER ID The ID of the recipe. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-RecipeMedia -ID '12345' Retrieves the media details for the recipe with ID 12345. .EXAMPLE Get-RecipeMedia -ID '12345' -Raw Retrieves the raw JSON response for the recipe media with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the recipe.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/recipe/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Region.ps1 --- function Get-Region { <# .SYNOPSIS Retrieves the region information for a specified World of Warcraft ID. .DESCRIPTION This function fetches region information from the World of Warcraft API for a given region ID. The ID is mandatory and the response can be optionally formatted or returned as raw JSON. .PARAMETER Id The ID of the region. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Region -Id 1 Retrieves the formatted region information for the region with ID 1. .EXAMPLE Get-Region -Id 1 -Raw Retrieves the raw JSON response for the region with ID 1. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the region.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/region/{1}?namespace=dynamic-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-RegionIndex.ps1 --- function Get-RegionIndex { <# .SYNOPSIS Retrieves the index of available regions in World of Warcraft. .DESCRIPTION The function fetches the region index from the World of Warcraft API. An optional switch is available to return the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-RegionIndex Retrieves the list of available regions in a formatted manner. .EXAMPLE Get-RegionIndex -Raw Retrieves the raw JSON response of the available regions. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/region/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'regions') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty regions | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ReputationFaction.ps1 --- function Get-ReputationFaction { <# .SYNOPSIS Retrieves information about a specific reputation faction in World of Warcraft. .DESCRIPTION The function fetches data for a given reputation faction by its ID using the World of Warcraft API. The ID parameter is required. An optional switch is available to return raw JSON data. .PARAMETER Id The unique identifier for the reputation faction. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ReputationFaction -Id '2103' Retrieves information about the reputation faction with ID 2103. .EXAMPLE Get-ReputationFaction -Id '2103' -Raw Retrieves the raw JSON response for the reputation faction with ID 2103. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier for the reputation faction.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/reputation-faction/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ReputationFactionIndex.ps1 --- function Get-ReputationFactionIndex { <# .SYNOPSIS Retrieves the reputation faction index from World of Warcraft. .DESCRIPTION This function retrieves a list of reputation factions from the World of Warcraft API. It connects to the appropriate endpoint and provides either formatted data or raw JSON output depending on the parameters supplied. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ReputationFactionIndex Retrieves the formatted list of reputation factions from the World of Warcraft API. .EXAMPLE Get-ReputationFactionIndex -Raw Retrieves the raw JSON response of the reputation factions from the World of Warcraft API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/reputation-faction/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ReputationTiers.ps1 --- function Get-ReputationTiers { <# .SYNOPSIS Retrieves reputation tiers for a specific ID in World of Warcraft. .DESCRIPTION This function retrieves the reputation tiers based on a given ID using the World of Warcraft API. The ID is a required parameter and must not be empty. An optional switch is available to return the raw JSON response. .PARAMETER Id The ID of the reputation tier. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ReputationTiers -Id '12345' Retrieves the reputation tiers for the ID '12345' in a formatted output. .EXAMPLE Get-ReputationTiers -Id '12345' -Raw Retrieves the raw JSON response for the reputation tiers for the ID '12345'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the reputation tier.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/reputation-tiers/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ReputationTiersIndex.ps1 --- function Get-ReputationTiersIndex { <# .SYNOPSIS Retrieves the list of reputation tiers available in World of Warcraft. .DESCRIPTION The function fetches a list of reputation tiers using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-ReputationTiersIndex Retrieves the formatted list of reputation tiers. .EXAMPLE Get-ReputationTiersIndex -Raw Retrieves the raw JSON response of reputation tiers. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/reputation-tiers/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'reputation_tiers') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty reputation_tiers | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Soulbind.ps1 --- function Get-Soulbind { <# .SYNOPSIS Retrieves the Soulbind information of a specified character in World of Warcraft. .DESCRIPTION The function fetches the Soulbind details for a given character using the World of Warcraft API. The realm slug and character name are required parameters. An optional switch is available to return raw JSON data. .PARAMETER realmSlug The slug of the realm. This is required and must not be empty. .PARAMETER characterName The name of the character. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Soulbind -realmSlug 'azshara' -characterName 'strandmaus' Retrieves the Soulbind information for the character named Strandmaus on the Azshara realm. .EXAMPLE Get-Soulbind -realmSlug 'azshara' -characterName 'strandmaus' -Raw Retrieves the raw JSON response of the Soulbind information for the character named Strandmaus on the Azshara realm. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param ( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier for the soulbind.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/soulbind/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } if($result.PSObject.Properties['character']) { $result.PSObject.Properties.Remove('character') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-SoulbindIndex.ps1 --- function Get-SoulbindIndex { <# .SYNOPSIS Retrieves the soulbind index for a specified character in World of Warcraft. .DESCRIPTION The function fetches the soulbind index for a given character using the World of Warcraft API. The realm slug and character name are required parameters. An optional switch is available to return raw JSON data. .PARAMETER realmSlug The slug of the realm. This is required and must not be empty. .PARAMETER characterName The name of the character. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-SoulbindIndex -realmSlug 'azshara' -characterName 'strandmaus' Retrieves the soulbind index for the character named Strandmaus on the Azshara realm. .EXAMPLE Get-SoulbindIndex -realmSlug 'azshara' -characterName 'strandmaus' -Raw Retrieves the raw JSON response of the soulbind index for the character named Strandmaus on the Azshara realm. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param ( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/covenant/soulbind/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'soulbinds') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty soulbinds | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Spell.ps1 --- function Get-Spell { <# .SYNOPSIS Retrieves information about a spell in World of Warcraft. .DESCRIPTION The function fetches detailed information for a given spell ID using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Id The unique identifier for the spell. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Spell -Id '12345' Retrieves the formatted information about the spell with ID 12345. .EXAMPLE Get-Spell -Id '12345' -Raw Retrieves the raw JSON response for the spell with ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique identifier for the spell.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/spell/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-SpellMedia.ps1 --- function Get-SpellMedia { <# .SYNOPSIS Retrieves media information for a specified spell in World of Warcraft. .DESCRIPTION The function fetches media information for a given spell using the World of Warcraft API. The spell ID is a required parameter. An optional switch is available to return the raw JSON response. .PARAMETER ID The ID of the spell. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-SpellMedia -ID '12345' Retrieves the media information for the spell with the ID 12345. .EXAMPLE Get-SpellMedia -ID '12345' -Raw Retrieves the raw JSON response for the spell media information with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the spell.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/spell/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Talent.ps1 --- function Get-Talent { <# .SYNOPSIS Retrieves talent information of a specified talent ID in World of Warcraft. .DESCRIPTION The function fetches detailed information about a talent using the World of Warcraft API. The talent ID is required as a parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The ID of the talent. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Talent -Id '123' Retrieves the information for the talent with ID 123. .EXAMPLE Get-Talent -Id '123' -Raw Retrieves the raw JSON response of the talent information for the ID 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the talent.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/talent/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TalentIndex.ps1 --- function Get-TalentIndex { <# .SYNOPSIS Retrieves the talent index in World of Warcraft. .DESCRIPTION The function fetches a list of all available talents using the World of Warcraft API. The optional -Raw switch can be used to return the unformatted response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TalentIndex Retrieves the formatted list of talents available in World of Warcraft. .EXAMPLE Get-TalentIndex -Raw Retrieves the raw JSON response for the list of talents available in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/talent/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'talents') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty talents | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TalentTree.ps1 --- function Get-TalentTree { <# .SYNOPSIS Retrieves the talent tree for a specified specialization in World of Warcraft. .DESCRIPTION The function fetches the talent tree for a given specialization using the World of Warcraft API. The talent tree ID and specialization ID are required parameters. An optional switch is available to return raw JSON data. .PARAMETER TalentTreeID The ID of the talent tree. This is required and must not be empty. .PARAMETER SpecID The ID of the specialization. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TalentTree -TalentTreeID '123' -SpecID '456' Retrieves the talent tree for the specialization with ID 456 in the talent tree 123. .EXAMPLE Get-TalentTree -TalentTreeID '123' -SpecID '456' -Raw Retrieves the raw JSON response of the talent tree for the specialization with ID 456 in the talent tree 123. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the talent tree.')] [ValidateNotNullOrEmpty()] [String]$TalentTreeID, [Parameter(Mandatory, Position = 1, HelpMessage = 'The ID of the specialization.')] [ValidateNotNullOrEmpty()] [String]$SpecID, [Parameter(Position = 2, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/talent-tree/{1}/playable-specialization/{2}?namespace=static-{3}&locale={4}' -f $Global:WoWBaseURL, $TalentTreeID, $SpecID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TalentTreeIndex.ps1 --- function Get-TalentTreeIndex { <# .SYNOPSIS Retrieves the talent tree index from World of Warcraft API. .DESCRIPTION The function fetches the talent tree index using the World of Warcraft API. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TalentTreeIndex Retrieves the formatted talent tree index. .EXAMPLE Get-TalentTreeIndex -Raw Retrieves the raw JSON response of the talent tree index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/talent-tree/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TalentTreeNodes.ps1 --- function Get-TalentTreeNodes { <# .SYNOPSIS Retrieves the talent tree nodes of a specified character in World of Warcraft. .DESCRIPTION The function fetches a list of talent tree nodes for a given character using the World of Warcraft API. The character ID is required. An optional switch is available to return raw JSON data. .PARAMETER Id The talent tree ID. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TalentTreeNodes -Id '12345' Retrieves the talent tree nodes for the given talent tree ID '12345'. .EXAMPLE Get-TalentTreeNodes -Id '12345' -Raw Retrieves the raw JSON response for the given talent tree ID '12345'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the talent tree.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/talent-tree/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } if($result.PSObject.Properties['character']) { $result.PSObject.Properties.Remove('character') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TechTalent.ps1 --- function Get-TechTalent { <# .SYNOPSIS Retrieves the tech talent information for a specified character in World of Warcraft. .DESCRIPTION This function fetches the tech talent details based on the provided talent ID using the World of Warcraft API. An optional switch is available to return the raw JSON response. .PARAMETER Id The ID of the tech talent. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TechTalent -Id '12345' Retrieves the tech talent information for the specified ID. .EXAMPLE Get-TechTalent -Id '12345' -Raw Retrieves the raw JSON response of the tech talent information for the specified ID. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the tech talent.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/tech-talent/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TechTalentIndex.ps1 --- function Get-TechTalentIndex { <# .SYNOPSIS Retrieves the list of available tech talents in World of Warcraft. .DESCRIPTION The function fetches an index of all tech talents using the World of Warcraft API. The function can return either a formatted result or the raw JSON response. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TechTalentIndex Retrieves the list of available tech talents in World of Warcraft. .EXAMPLE Get-TechTalentIndex -Raw Retrieves the raw JSON response of available tech talents in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/tech-talent/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'talents') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty talents | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TechTalentMedia.ps1 --- function Get-TechTalentMedia { <# .SYNOPSIS Retrieves media assets for a specified tech talent in World of Warcraft. .DESCRIPTION The function fetches media assets associated with a specific tech talent by using the World of Warcraft API. The tech talent ID is required, and an optional switch can be used to return the raw JSON response. .PARAMETER ID The unique ID of the tech talent. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TechTalentMedia -ID '12345' Retrieves the media assets for the tech talent with the ID 12345. .EXAMPLE Get-TechTalentMedia -ID '12345' -Raw Retrieves the raw JSON response for the tech talent with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the tech talent.')] [ValidateNotNullOrEmpty()] [String]$ID, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/media/tech-talent/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $ID, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'assets') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty assets | Select-Object -ExpandProperty value } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TechTalentTree.ps1 --- function Get-TechTalentTree { <# .SYNOPSIS Retrieves the technology talent tree details for a given ID in World of Warcraft. .DESCRIPTION This function fetches details of a technology talent tree using the World of Warcraft API. The ID of the talent tree is required, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the technology talent tree. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TechTalentTree -Id '12345' Retrieves the formatted technology talent tree details for the specified ID. .EXAMPLE Get-TechTalentTree -Id '12345' -Raw Retrieves the raw JSON response of the technology talent tree for the specified ID. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the technology talent tree.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/tech-talent-tree/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TechTalentTreeIndex.ps1 --- function Get-TechTalentTreeIndex { <# .SYNOPSIS Retrieves the index of the tech talent tree in World of Warcraft. .DESCRIPTION The function fetches a list of tech talent trees using the World of Warcraft API. The endpoint path is used to request the available tech talent trees. An optional switch is available to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TechTalentTreeIndex Retrieves a formatted list of all tech talent trees sorted by ID. .EXAMPLE Get-TechTalentTreeIndex -Raw Retrieves the raw JSON response of all tech talent trees. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/tech-talent-tree/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'talent_trees') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty talent_trees | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Title.ps1 --- function Get-Title { <# .SYNOPSIS Retrieves the title information for a specified character in World of Warcraft. .DESCRIPTION The function fetches the title information based on the given title ID from the World of Warcraft API. The title ID is a mandatory parameter, and an optional switch is available to return raw JSON data. .PARAMETER Id The ID of the title. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Title -Id '12345' Retrieves the title information for the specified title ID '12345'. .EXAMPLE Get-Title -Id '12345' -Raw Retrieves the raw JSON response for the specified title ID '12345'. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The ID of the title.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/title/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-TitleIndex.ps1 --- function Get-TitleIndex { <# .SYNOPSIS Retrieves the available titles in World of Warcraft. .DESCRIPTION The function fetches a list of available titles using the World of Warcraft API. The optional -Raw parameter allows for returning the raw JSON data instead of a formatted result. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-TitleIndex Retrieves a formatted list of available titles in World of Warcraft. .EXAMPLE Get-TitleIndex -Raw Retrieves the raw JSON response of the available titles in World of Warcraft. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/title/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'titles') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty titles | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-Toy.ps1 --- function Get-Toy { <# .SYNOPSIS Retrieves the details of a specified toy in World of Warcraft. .DESCRIPTION The function fetches information about a toy using the World of Warcraft API. The toy ID is a mandatory parameter. An optional switch is available to return raw JSON data. .PARAMETER Id The unique ID of the toy. This is required and must not be empty. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-Toy -Id '12345' Retrieves the formatted details of the toy with the ID 12345. .EXAMPLE Get-Toy -Id '12345' -Raw Retrieves the raw JSON response of the toy details with the ID 12345. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Mandatory, Position = 0, HelpMessage = 'The unique ID of the toy.')] [ValidateNotNullOrEmpty()] [String]$Id, [Parameter(Position = 1, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/toy/{1}?namespace=static-{2}&locale={3}' -f $Global:WoWBaseURL, $Id, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-ToyIndex.ps1 --- function Get-ToyIndex { <# .SYNOPSIS Retrieves the index of toys in World of Warcraft. .DESCRIPTION This function fetches the list of toys from the World of Warcraft API. It connects to the API endpoint and retrieves all available toys, with an option to return raw JSON data. .PARAMETER Raw Optional switch to return the raw JSON response from the API instead of a formatted output. .EXAMPLE Get-ToyIndex Retrieves the list of toys available in the World of Warcraft API. .EXAMPLE Get-ToyIndex -Raw Retrieves the raw JSON response of the list of toys available in the World of Warcraft API. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/toy/index?namespace=static-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result -and $result.PSobject.Properties.name -contains 'toys') { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' return $result | Select-Object -ExpandProperty toys | Sort-Object -Property id } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: Get-WoWTokenIndex.ps1 --- function Get-WoWTokenIndex { <# .SYNOPSIS Retrieves the WoW token index information for the current region. .DESCRIPTION The function fetches the WoW token index for the specified region using the World of Warcraft API. This includes information like the current token price and its status. The optional Raw parameter can be used to get the native JSON result. .PARAMETER Raw Optional switch to return the raw JSON response from the API. .EXAMPLE Get-WoWTokenIndex Retrieves the WoW token index information in a formatted manner. .EXAMPLE Get-WoWTokenIndex -Raw Retrieves the raw JSON response of the WoW token index. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft/game-data-apis #> param( [Parameter(Position = 0, HelpMessage = 'Return raw JSON data.')] [Switch]$Raw ) if(Test-WoWApiConnection) { $URL = '{0}data/wow/token/index?namespace=dynamic-{1}&locale={2}' -f $Global:WoWBaseURL, $Global:WoWRegion, $Global:WoWLocalization try { $result = Invoke-RestMethod -Uri $URL -Headers $Global:WoWApiAuthHeader -TimeoutSec 5 if($result) { if($Raw) { return $result } else { Write-Verbose -Message 'This is a formatted result. To get the native result use the -Raw parameter.' if($result.PSObject.Properties['_links']) { $result.PSObject.Properties.Remove('_links') } return $result } } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode Write-Verbose -Message ('Bad status code ({0}) {1}' -f $statusCode, $status) } } } # --- Importing: init.ps1 --- # use this file to define global variables on module scope # or perform other initialization procedures. # this file will not be touched when new functions are exported to # this module. # --- Importing: Set-WoWApiAccessToken.ps1 --- function Set-WoWApiAccessToken { <# .SYNOPSIS Retrieves and sets the World of Warcraft API access token. .DESCRIPTION The `Set-WoWApiAccessToken` function retrieves an OAuth 2.0 access token from Blizzard's Battle.net API using the provided client credentials (`ClientId` and `ClientSecret`). This token is required for authenticating API requests to Blizzard's World of Warcraft API. The function stores the access token header in the global variable `WoWApiAuthHeader`. .PARAMETER ClientId The client ID issued by Blizzard when registering an application for API access. This is required to authenticate and retrieve the access token. .PARAMETER ClientSecret The client secret issued by Blizzard when registering an application for API access. This is required to authenticate and retrieve the access token. .EXAMPLE Set-WoWApiAccessToken -ClientId 'Strandmaus-client-id' -ClientSecret 'Strandmaus-client-secret' Retrieves the access token using the specified client ID and client secret, and stores it in the global variable `$Global:WoWApiAuthHeader`. .NOTES - Ensure that you have valid client credentials from Blizzard's API. - The access token header is stored globally, allowing it to be used in subsequent API requests. .OUTPUTS The function does not output anything on success, but returns an error message if the request fails. .ERRORS If the request fails, the function will return a string indicating the HTTP status code and message. #> param ( [Parameter(Mandatory, Position = 0, HelpMessage = 'The client ID issued by Blizzard for API access.')] [ValidateNotNullOrEmpty()] [String] $ClientId, [Parameter(Mandatory, Position = 1, HelpMessage = 'The client secret issued by Blizzard for API access.')] [ValidateNotNullOrEmpty()] [String] $ClientSecret ) $credPlain = '{0}:{1}' -f $ClientId, $ClientSecret $utf8Encoding = [Text.UTF8Encoding]::new() $credBytes = $utf8Encoding.GetBytes($credPlain) $base64auth = [Convert]::ToBase64String($credBytes) $RequestData = @{ Method = 'POST' Uri = 'https://oauth.battle.net/token' ContentType = 'application/x-www-form-urlencoded' Body = 'grant_type=client_credentials' Headers = @{ Authorization = ('Basic {0}' -f $base64auth) } UseBasicParsing = $true } try { $result = Invoke-RestMethod @RequestData if($result) { $Global:WoWApiAuthHeader = @{ Authorization = 'Bearer ' + $result.access_token } $Global:WoWAccessToken = $result.access_token } } catch { $statusCode = $_.Exception.Response.StatusCode.value__ $status = $_.Exception.Response.StatusCode return ('Bad status code ({0}) {1}' -f $statusCode, $status) } } # --- Importing: Set-WoWRegion.ps1 --- function Set-WoWRegion { <# .SYNOPSIS Sets the World of Warcraft API region and language for API requests. .DESCRIPTION The `Set-WoWRegion` function sets the region and language for World of Warcraft API requests by defining several global variables such as `WoWBaseURL`, `WoWRegion`, and `WoWLocalization`. It supports regions like China, Europe, Korea, North America, and Taiwan, and dynamically assigns a language depending on the chosen region. The function takes the region as a mandatory parameter, and based on the region, it dynamically generates a list of valid languages for that region. It then sets the corresponding base URL, region code, and localization settings that are used in World of Warcraft API requests. .PARAMETER Region Specifies the World of Warcraft region for which to set the API base URL. The available regions are: - China - Europe - Korea - North America - Taiwan .PARAMETER Language Specifies the language for the World of Warcraft API requests. The available languages depend on the region. For example: - Europe: English, French, German, Italian, Russian, Spanish (Spain) - North America: English (United States), Portuguese, Spanish (Mexico) - China: Chinese (Simplified) This parameter is dynamically generated based on the selected region. .EXAMPLE Set-WoWRegion -Region Europe -Language German Sets the API region to Europe and the language to German. This updates the global variables for the base URL, region code, and localization settings for API requests. .EXAMPLE Set-WoWRegion -Region North America -Language English Sets the API region to North America and the language to English (United States). .NOTES This function dynamically defines the available languages based on the chosen region and sets the corresponding global variables used for World of Warcraft API queries. The global variables that are updated by this function are: - `$Global:WoWBaseURL`: The base URL for the selected region's API. - `$Global:WoWRegion`: The two-letter region code (e.g., US, EU). - `$Global:WoWLocalization`: The localization code for the selected language (e.g., en_GB, de_DE). The function also supports verbose output for debugging purposes, which prints the set values for the global variables. .LINK https://develop.battle.net/documentation/world-of-warcraft #> param ( [Parameter(Mandatory,HelpMessage = 'Specify the World of Warcraft region. Available options: China, Europe, Korea, North America, Taiwan.')][ValidateSet('China','Europe','Korea','North America','Taiwan')][String] $Region # The region to set (e.g., Europe, North America, etc.) ) dynamicparam { # Define available languages based on the selected region $data = @{ 'China' = 'Chinese (Simplified)' 'Europe' = 'English (Great Britain)', 'French', 'German', 'Italian', 'Russian', 'Spanish (Spain)' 'Korea' = 'Korean' 'North America' = 'English (United States)', 'Portuguese', 'Spanish (Mexico)' 'Taiwan' = 'Chinese (Traditional)' } # Create dynamic parameter for Language based on the region $paramDictionary = New-Object -TypeName System.Management.Automation.RuntimeDefinedParameterDictionary $attributeCollection = New-Object -TypeName System.Collections.ObjectModel.Collection[System.Attribute] # Add the mandatory attribute to the dynamic parameter $attribute = New-Object -TypeName System.Management.Automation.ParameterAttribute $attribute.Mandatory = $true $attributeCollection.Add($attribute) # Validate the dynamic parameter with the correct set of languages based on region $attribute = New-Object -TypeName System.Management.Automation.ValidateSetAttribute -ArgumentList ($data.$Region) $attributeCollection.Add($attribute) # Create the dynamic Language parameter $attributeName = 'Language' $dynParam = New-Object -TypeName System.Management.Automation.RuntimeDefinedParameter -ArgumentList ($attributeName, [string], $attributeCollection) $paramDictionary.Add($attributeName, $dynParam) $paramDictionary } end { # Mapping language names to localization codes $regionLanguage = @{ 'Chinese (Simplified)' = 'zh_CN' 'Chinese (Traditional)' = 'zh_TW' 'English (Great Britain)' = 'en_GB' 'English (United States)' = 'en_US' 'French' = 'fr_FR' 'German' = 'de_DE' 'Italian' = 'it_IT' 'Korean' = 'ko_KR' 'Portuguese' = 'pt_BR' 'Russian' = 'ru_RU' 'Spanish (Mexico)' = 'es_MX' 'Spanish (Spain)' = 'es_ES' } # Mapping region names to base URLs $regionHost = @{ 'China' = 'https://gateway.battlenet.com.cn/' 'Europe' = 'https://eu.api.blizzard.com/' 'Korea' = 'https://kr.api.blizzard.com/' 'North America' = 'https://us.api.blizzard.com/' 'Taiwan' = 'https://tw.api.blizzard.com/' } # Mapping region names to two-letter codes $regionTwoLetter = @{ 'China' = 'CN' 'Europe' = 'EU' 'Korea' = 'KR' 'North America' = 'US' 'Taiwan' = 'TW' } # Set global variables based on the selected region and language $Global:WoWBaseURL = $regionHost.$Region $Global:WoWRegion = $regionTwoLetter.$Region $Global:WoWLocalization = $regionLanguage.$($PSBoundParameters.Language) # Verbose output if requested if($PSBoundParameters.Verbose) { Write-Verbose -Message ("The global variable WoWBaseURL has been set to '{0}'." -f ($Global:WoWBaseURL)) Write-Verbose -Message ("The global variable WoWRegion has been set to '{0}'." -f ($Global:WoWRegion)) Write-Verbose -Message ("The global variable WoWLocalization has been set to '{0}'." -f ($Global:WoWLocalization)) } } } # --- Importing: Test-WoWApiConnection.ps1 --- function Test-WoWApiConnection { <# .SYNOPSIS Tests if the World of Warcraft API connection variables are set and validates the access token using the correct OAuth endpoint. .DESCRIPTION This function checks if the necessary global variables for the World of Warcraft API connection are initialized. Additionally, it sends a POST request to the Battle.net OAuth API (`https://oauth.battle.net/check_token`) to validate the access token. The global variables required are: - $Global:WoWRegion: The region for the WoW API (e.g., 'us', 'eu'). - $Global:WoWLocalization: The language for localization (e.g., 'en_US'). - $Global:WoWBaseURL: The base URL for the WoW API. - $Global:WoWAccessToken: The access token for authenticating API requests. .EXAMPLE Test-WoWApiConnection # This will check if the WoW API connection variables are set and try to validate the access token. .OUTPUTS [Boolean] Returns $true if all necessary variables are set and the access token is valid. Throws an error if any required variable is missing or the token validation fails. .NOTES This function requires the World of Warcraft API to be accessible and valid credentials to be configured in the global variables. .LINK https://develop.battle.net/documentation/battle-net/oauth-apis #> if( $null -eq $Global:WoWRegion -or $null -eq $Global:WoWLocalization -or $null -eq $Global:WoWBaseURL -or $null -eq $Global:WoWApiAuthHeader ) { throw 'The connection variables for the WoW API were not set. Please execute the commands `Set-WoWRegion` and `Set-WoWApiAccessToken`.' } try { $tokenValidationUrl = 'https://oauth.battle.net/check_token' $params = @{ token = $Global:WoWAccessToken } $response = Invoke-RestMethod -Uri $tokenValidationUrl -Method Post -ContentType 'application/x-www-form-urlencoded' -Body $params if($null -ne $response -and $null -ne $response.client_id) { return $true } else { throw 'API connection failed. Token validation returned no client_id or invalid response.' } } catch { throw 'API connection test failed: {0}' -f $_ } } |