The code looks like this:
$contentType=$r.BaseResponse.ContentType
$content=Get-Content $fileOut
$boundary=[system.Guid]::NewGuid().ToString()
$clientID=[system.Guid]::NewGuid().ToString()
$body=(
"--$boundary",
'Content-Disposition: form-data; name="type"',
'',
"image",
"--$boundary",
"Content-Disposition: form-data; name=""files[]"" filename=$imageName",
"Content-Type: ""$contentType""",
'',
"$content",
"--$boundary--"
) -join "`r`n"
$tempURL=$urlTo+"uploads.json"+$loginTo+"&client_id=$clientID&synchronous=1"
$resp=Invoke-WebRequest $tempURL -Method Post -ContentType "multipart/form-data; boundary=$boundary" -Body $body -Verbose
$urlTo is the url for the site, $loginTo is the APIkey and username. The $r at the top is the response from downloading the image from another site to a file called $fileOut