attach a file using Powershell

attach a file using Powershell

Hello. I want to attach a file by using Powershell to an existing task. I execute the script:
$url = ' https://serversdp/sdpapi/request/42194/attachment?OPERATION_NAME=ADD_ATTACHMENT&TECHNICIAN_KEY=743534B0-FB42-45AC-8BC7-AC9D420FDD18'
$fname = 'C:\temp\1.txt'
Invoke-RestMethod -Uri $url -Method post -InFile $fname -ContentType "multipart/form-data"

The Service Desk creates a record that the request is modified, but the file is not attached
How Solve Problem? thanks!