Invoke-WebRequest, POST with parameters

Put your parameters in a hash table and pass them like this:

$postParams = @{username="me";moredata="qwerty"}
Invoke-WebRequest -Uri http://example.com/foobar -Method POST -Body $postParams

Leave a Comment