Closed
Description
Hiya, Not sure if Add-ServiceNowAttachment is supposed to do multiple files.
If it is, I think the Content-Type header might be duplicated in the ForEach loop here:
I think with multi-file you'll want the type to be multipart or octet-stream. Haven't tried fixing it yet, currently just working around by sending one file at a time.
Environment
Operating System: Windows Powershell
ServiceNow module version: 3.4.1
PowerShell version: 5.1
Steps to reproduce
Use a splat containing two filepath
$addServiceNowAttachmentSplat = @{
ID = $Ticket.Number
Table = 'incident'
File = $LogFilePath, $OutputFilePath
}
Add-ServiceNowAttachment @addServiceNowAttachmentSplat
Expected behavior
Multiple files upload to service now incident
Actual behavior
First item is uploaded, next files generate error
"Item has already been added. Key in dictionary: 'Content-Type' Key being added: 'Content-Type'"
Screenshots
Metadata
Metadata
Assignees
Labels
No labels