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'}
}

mimetypes.txt example

extension, mimeType
.xap, application/x-silverlight-app
.xls, application/vnd.ms-excel

Leave a Reply

Scroll to Top