用dev.battle.net解析JSON与Powershell(魔兽世界API)

Parsing JSON with Powershell from dev.battle.net (World of Warcraft API)

Because I can't be at work today (post-appendectomy) but still want to work on my PowerShell skills, I decided I would try to access the World of Warcraft API and pull down auction house data for fun.

$apiKey = "myapikey"
$serverName = "MyServer"
$webAddress = "https://us.api.battle.net/wow/auction/data/"

$url = $webAddress + $serverName + "?apikey=" + $apiKey

$response = Invoke-RestMethod -Uri $url -ContentType "application/json"

$aucURL = $response.files.url
$aucTime = $response.files.lastModified

$response = Invoke-RestMethod -Uri $aucURL

$aucData = $response.auctions #Always returns blank

I get to this point and get a huge list of data that looks like below and for the life of me I can't seem to access the auctions data.

{
"realms": [
    {"name":"MyServer","slug":"MyServer"}],
"auctions": [
    {"auc":723774847,"item":109167,"owner":"Laddypally","bid":369550,"buyout":389000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0,"context":1},
    {"auc":724234542,"item":2996,"owner":"Mazramtaim","bid":760000,"buyout":800000,"quantity":20,"timeLeft":"VERY_LONG","rand":0,"seed":0,"context":0},
    {"auc":723207271,"item":133563,"owner":"Alsalak","bid":1187500,"buyout":1250000,"quantity":5,"timeLeft":"LONG","rand":0,"seed":0,"context":0}]}

My method of taking $responses.whatever has worked in the past with my work related PS stuff but not here. Any reason why?

Upgrading to PowerShell 5 fixed the issue. I didn't change any of the code so the issue must've been in how PS4 deals with large JSON requests.