Import-mimeTypes

Import mimeTypes

 

$MimeList = Import-Csv .\mimetypes.txt

ForEach ($Mime in $MimeList) {
add-webconfigurationproperty //staticContent -name collection -value @{fileExtension='$Mime.extension';mimeType='$Mime.mimeType'}
}
[/sourcecode]

mimetypes.txt example
[sourcecode language="text" wraplines="false"]
extension, mimeType
.xap, application/x-silverlight-app
.xls, application/vnd.ms-excel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top