Ensure_SiteColumn_Delete

Language:
PowerShell
Keywords:
SharePoint
Code Snippet

Function Ensure_SiteColumn_Delete( [Microsoft.SharePoint.SPWeb]$tWeb
                                 , $tFieldName
                                 ) {

    if ($tWeb.Fields[$tFieldName]) {
        Write-Output([System.String]::Format("Column [{1}] : Deleting from Web [{0}]", $tWeb.Url, $tFieldName))
        $tWeb.Fields[$tFieldName].Delete()
        $tWeb.Update()
    }
} # Function Ensure_SiteColumn_Delete(...)


Created 2011-10-13
comments powered by Disqus
Login