How to add column in to List using Power Shell

In this Post we are able to show, how to add the “Multi Choice” column   to the Particular list and also we can check the condition that column is available in that list or not.
In our Example we created a List with Name “SharePoint List” using power shell created a column and adding the Values.

Add-PSSnapin Microsoft.SharePoint.PowerShell
#Get the Site URL
$weburl = Get-SPWeb ""
#Get the List Name
$list = $weburl.lists["SharePoint List"]
#check condition field is available or not
if($list.Fields.ContainsField("SharePoint") -eq $true)  {
      Write-Host  "FieldName already avilable in the List"
 #Add New choice field to the list
$list.Fields.Add("SharePoint", [Microsoft.SharePoint.SPFieldType]::Choice,
#Add Choices to the field
$ChoiceField = $list.Fields.GetField("SharePoint")
#Get the field #Required Field
$ChoiceField.Required = $true
#Set Default value
$ChoiceField.DefaultValue = “SharePoint2013"
#Allow Fill-in Choices
$ChoiceField.FillInChoice = $false
#Add the Drop down choice values
#Commit changes


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment


Post a Comment