Thursday, August 11, 2011

Adding a mime type to IIS vis powershell

You must have the WebAdministration snappin or module loaded (this should come as part of the IIS install) then simply:

add-webconfigurationproperty //staticContent -name collection -value @{fileExtension='.otf'; mimeType='application/octet-stream'}


  1. Thanks for this. One thing to look out for is that the working directory hasn't been changed to a sub-directory of IIS:\
    I tried to run this command after previous scripts had done a "cd IIS:\appPools" and it did not work. cd IIS:\ fixed it.

  2. Easton Bell Electrical are your Melbourne based electricians, and it is our priority that
    we provide you with a friendly and courteous service while being professional and well presented.
    We pride ourselves on being on time and discussing with you what work suits you best. And best of all, We Clean Up!Caulfield Electrician