Mime Types for .ps1 files

I am trying to setup IIS to display .ps1 files in text format (i.e. same way it deals with .txt files, where it displays the contents in the browser). I set it up to be a text/plain but it still prompts me to download the file when I browse to it.


What else am I missing?

March 22nd, 2015 6:28pm

I would recommend asking them here: http://forums.iis.net/
Free Windows Admin Tool Kit Click here and download it now
March 22nd, 2015 6:44pm

Will do!   I looked around and couldn't find an IIS forum.
March 22nd, 2015 6:50pm

Hi Daniel,

Agree with Mr X, in addition, you can also refer to this similar disscusion:

In your IIS Manager, select the server node on the tree, and click "MIME Types". Then click "Add..." on the right panel. For extension, set it to .ps1, and set the MIME type to text/plain.

You can do this for a specific web application or virtual directory, too. If you are doing this through web.config, it would look something like this, please backup this configuration file before edit:

<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".ps1" mimeType="text/plain" /><!-- or application/octet-stream -->
        </staticContent>
    </system.webServer>
</configuration>

Refer to:

Download powershell (.ps1) file via ASP.NET

If you have any feedback on our support, please click here.

Best Regards,

Anna Wang

TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
March 22nd, 2015 11:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics