Remove a SharePoint column in PowerShell

I was trying to remove an existing column from a list through the UI without any success. The solution lay in removing it through the 'back end' with my good friend PowerShell.

Here is the code:

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

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

Error deploying Nintex workflow: An item with the same key has already been added