Closed natescherer closed 3 years ago
Hey @natescherer, nice work on this! I'd ask for 2 changes please, 1 small, 1 not so small 😄 Can we move this into a config file? It feels like that's a better place for it not just aesthetically, but for reuse. Perhaps /ServiceNow/config/MimeTypeMap.json
? There's an example in the .psm1 for main.json. Also, can you throw a link to the .cs file in there? Thanks much!
Done!
Awesome, thanks, working well. Last change and then we are good. The .json just needs to be converted to utf8.
Good catch, I did an Out-File to create the JSON from the hash and I forgot to set the encoding. It's fixed now.
This is a fix for Add-ServiceNowAttachment not working on PowerShell 7.
As there does not appear to be a .NET Core replacement for System.Web.MimeMapping, I created a static hash of mime types derived from https://github.com/samuelneff/MimeTypeMap/blob/master/MimeTypeMap.cs. I have tested and this works on Windows PowerShell 5.1 and PowerShell 7.1.3.
Please let me know if you have any questions!