I had a heck of a time turning that into simpler terms, but it’s really just saying that the RawContentLength of the replied content is too large. Queue the sad trombone.
It’s not possible to adjust this value using PowerShell, but I did manage to find some folks who wrote the necessary .NET code to tweak the value. I’ve adjusted the format slightly.
Cleaning Up the Generic Dictionary
The resolution is to use a helper function to parse through and clean up the dictionary. A handy one is provided by Florian here. Again, I’ve removed some of the unwanted code from the script to filter it down to just the needed functions.
By feeding the .NET Serializer data into the ParseItem function, the content is properly stored into a PowerShell hashtable. It takes a little bit to iterate through the values – be patient. 🙂
Now that the data is stored in a proper hashtable, it can be used for other nefarious activities. This one stumped me a bit at first, so I hope my work helps anyone else dealing with large JSON payloads. A hat tip to those who wrote the code above so that I could piece it all together here.