Uploading file to HTTP via Powershell

A year late, so you probably don’t need the answer anymore, but what worked for me was:

Invoke-RestMethod -Uri $uri -Method Post -InFile $uploadPath -UseDefaultCredentials

Mine needed to use windows auth as the currently logged in user… From this other answer, looks like you can use -cred in some cases and have to build out an Authorization header in others.

Leave a Comment