I'm trying to convert this working request done in Cygwin to Powershell:
Cygwin (Working):
curl -k -u curl:Password -X PUT -F "file=$($_)" https://$($appliance)/wse/customblockpage/file/en
Powershell (not working):
Invoke-Webrequest -Uri "https://$($appliance)/wse/customblockpage/file/en" -Method Put -Infile "$homePath\$($_)" -Credential $cred
Here is the error I get:
Invoke-Webrequest : { "Error": "No file part in file", "Result": "Failure" } At line:1 char:1 + Invoke-Webrequest https://{IP Address Masked}/wse/customblockpage/file/en ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand