{"id":4525,"date":"2015-07-24T09:47:53","date_gmt":"2015-07-24T09:47:53","guid":{"rendered":"http:\/\/ngenioussolutions.com\/blog\/?p=84"},"modified":"2025-12-01T13:16:34","modified_gmt":"2025-12-01T13:16:34","slug":"how-to-activate-mime-type-using-powershell","status":"publish","type":"post","link":"https:\/\/ngenioussolutions.com\/blog\/how-to-activate-mime-type-using-powershell\/","title":{"rendered":"How to Activate MIME Type using Powershell"},"content":{"rendered":"<p>$mime = &#8220;text\/html&#8221;<br \/>\n$webAppUrl = &#8220;http:\/\/test.company.com&#8221;<br \/>\n$webApp = Get-SPWebApplication $webAppUrl<\/p>\n<p>If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $mime)<br \/>\n{<br \/>\nWrite-Host -ForegroundColor White &#8220;Adding MIME Type &#8220;$mime<br \/>\n#$webApp.AllowedInlineDownloadedMimeTypes.Add($mime)<br \/>\n#$webApp.Update()<br \/>\nWrite-Host -ForegroundColor Green &#8220;MIME Type added and saved.&#8221;<br \/>\n}<br \/>\nElse<br \/>\n{<br \/>\nWrite-Host -ForegroundColor Yellow $mime&#8221; MIME type is already added.&#8221;<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$mime = &#8220;text\/html&#8221; $webAppUrl = &#8220;http:\/\/test.company.com&#8221; $webApp = Get-SPWebApplication $webAppUrl If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $mime) { Write-Host -ForegroundColor White &#8220;Adding MIME Type &#8220;$mime #$webApp.AllowedInlineDownloadedMimeTypes.Add($mime) #$webApp.Update() Write-Host&#8230;<\/p>\n","protected":false},"author":1,"featured_media":8600,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-others"],"menu_order":0,"_links":{"self":[{"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4525"}],"version-history":[{"count":4,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4525\/revisions"}],"predecessor-version":[{"id":12491,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4525\/revisions\/12491"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/media\/8600"}],"wp:attachment":[{"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ngenioussolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}