Last active
November 26, 2025 21:24
-
-
Save dend/3beae357cb2b2b6480b217128e19d866 to your computer and use it in GitHub Desktop.
Get the list of Halo 5 ranks and render them in a table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $uri = "https://content-hacs.svc.halowaypoint.com/contents/SpartanRankManifest" | |
| try { | |
| $response = Invoke-RestMethod -Uri $uri -Method Get | |
| $results = foreach ($contentItem in $response. ContentItems) { | |
| $spartanRanks = $contentItem. View.SpartanRankManifest.SpartanRanks | |
| if ($spartanRanks -and $spartanRanks. Count -gt 0) { | |
| foreach ($rank in $spartanRanks) { | |
| $rankNumber = 0 | |
| if ($rank.View. Title -match '\d+$') { | |
| $rankNumber = [int]$Matches[0] | |
| } | |
| [PSCustomObject]@{ | |
| 'Rank' = $rankNumber | |
| 'Start XP' = '{0:N0}' -f $rank.View.SpartanRank. StartXP | |
| 'XP Scalar' = $rank.View.SpartanRank. SpartanRankMatchXPScalar | |
| 'Credit Multiplier' = $rank.View.SpartanRank.CreditMultiplier | |
| } | |
| } | |
| } | |
| } | |
| $results | Sort-Object { [int]($_. Rank) } | Format-Table -AutoSize | |
| } | |
| catch { | |
| Write-Error "Failed to retrieve data: $_" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment