Configure SharePoint Blocked File Types using PowerShell

I’m working on building a PowerShell Script Repository using SharePoint 2010 as the source system. During this work, I’ve obviously had to enable the .ps1 file type for my SharePoint Web Application. As I was doing this manually, I thought “Come on Ryan, surely you can do that with PowerShell!”. Of course I was able to do so, and it was very simple. I found a few examples online also during my quick search, but most were not leveraging the OOTB SP Cmdlets, so I’m posting my versions which use the Cmdlets which are included with SharePoint 2010.

I ended up creating 3 functions to handle the Get, Add and Remove operations. They’re all very similar, they literally just get the WebApplication object and then either return the list of BlockedFileExtensions or use the Add() or Remove() methods to perform the operations.