Ensure_List_Column_Delete

Language:
PowerShell
Keywords:
SharePoint
Code Snippet

Function Ensure_List_Column_Delete( [Microsoft.SharePoint.SPList]$tList
                                  , $tFieldName
                                  ) {
    if ($tList.Fields.ContainsField($tFieldName)) {
        Write-Output([System.String]::Format("Column [{1}] : Deleting from List [{0}]", $tList.Title, $tFieldName))
        $tList.Fields.Delete($tFieldName)
        $tList.Update()
    }
} # Function Ensure_List_Column_Delete(...)


Created 2011-10-13
comments powered by Disqus
Login