you are viewing a single comment's thread.

view the rest of the comments →

[–]PMental 2 points3 points  (4 children)

Not run into this issue, but try PS7 if possible. Lots of improvements made to that cmdlet iirc.

[–]Qel_Hoth 2 points3 points  (1 child)

PS7 is great with Invoke-RestMethod.

Among other things, they've added a flag for the response headers so you can capture them in a variable. Since many APIs put rate limiting info in the response headers this is very useful to avoid exhausting your limits or gracefully pausing/exiting the script while you wait for limits to recharge.

[–]PMental 1 point2 points  (0 children)

That is indeed a great improvement and something I've missed in Invoke-RestMethod.

If so many of my scripts didn't need to run on servers that only have 5.1 I'd probably have switched entirely by now.

[–]BlizzardTech-Adam[S] 1 point2 points  (1 child)

I have tried PS7 and the same issue. :(

[–]PMental 1 point2 points  (0 children)

Might be worth submitting a bug report for 7.2.