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