Error code 400 means "bad request".
You state that the curl and PowerShell are equivalent, but they two use different sets of headers. Could that be your problem?
Using a debugging tool such as Fiddler can help a lot when comparing the information you're sending with PowerShell to what curl is sending.
fiddler