Invoke-WebRequest -Method POST


I have a project to run a cmdlet whether on a server or workstation to get the list of updates which includes the description of the update, date/time installed, so I went ahead and used Get-WUHistory and it did showed me the results I wanted.

Here’s my issue, my boss wanted me to send/export the results instead of saving it to a file, he wants me to send the results to one of our websites. I used the cmdlet

Invoke-WebRequest -Uri https://<domain> -Method POST

But I talked to one of the developer of the website and told me to include the ff:

token: xxxxxxxxxx

private_ip: 192.x.x.x

I run the following cmdlet below:


Invoke-WebRequest -Uri https://<domain> -Method POST

And I’m getting a Bad Request (400) error so I’m not sure if I’m doing the proper way in doing POST



Hello Jeff,

Looks like you need to get more information from your API developer and use tools like Postman or any addons for your browser to debug/test your API requests. For example Resting for Mozilla:

From your post it appears that you need to provide auth token to your API(in headers or in query) and POST your Get-WUHistory output int the request body.

Hope that helps.