Tuesday, July 9, 2013

Check Column exist in SharePoint List using Powershell

Sometimes when we are working with SharePoint list items will get an error like

Column has been deleted by another user or not exist.

for this we can use below code to check column exist or not

 foreach($list in $web.Lists)
      {
         if($list.BaseType -eq "DocumentLibrary")
         {
              if( $list.Fields.ContainsField("ddlTest") -eq $true)
               {                                       
               Write-Host "found" $list.title
               }
               else
               {
                #  Write-Host "not found"  
               }
         }
      }

1 comment:

  1. That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
    Sharepoint Training in Chennai

    ReplyDelete

Followers