SharePoint – Deleting a Column from a List using PowerShell

I was creating a calculated column using SharePoint 2010 and I had an error in my formula. This caused my entire list to crash thus making it unavailable for anyone who wanted to view it. This post is about how I removed that column from SharePoint using PowerShell since the list the page it was on would no longer load, instead it had this nasty error every time someone clicked it.

Error – The “ListViewWebPart” Web Part appears to be causing a problem. Specified arguments was out of the range of a valid values.

 

Here are the PowerShell Commands to remove it.

PS> $web = Get-SPWeb -identity http://your/site/name
PS> $list = $web.Lists[“Your List Name”] PS> $column = $list.Fields[“Your Column Name”] PS> $column.Hidden = $false
PS> $column.ReadOnlyField = $false
PS > $column.Update()
PS > $list.Fields.Delete($column)