Add a Text Field to a SharePoint List

From Secrets of SharePont – Tip of the Day

You can use Windows PowerShell to add Text fields to a List in SharePoint 2010. Simply use the Add() method available on a fieldcollection. The example below demonstrates how to add a Text field to the Tasks list, set a Description and set the field as required. Note that the Add() method allows us to specify the Fields Name, the Type of Field and a Boolean value that determines if the field should be required.

PS > $spWeb = Get-SPWeb


PS > $spList = $spWeb.Lists[“Tasks”]

PS > $spList.Fields.Add(“Text Field”,”Text”,$true)

PS > $spList.Fields[“Text Field”].Description = “My Custom Text Field”

PS > $spList.Fields[“Text Field”].Update()

PS > $spWeb.Dispose()


Posted in SharePoint Tagged permalink

About Rick Backus

A technology consultant with over 25 years of IT, consulting and business technology industry experience. Specializing in integrating application, information and content management with business process and network infrastructure. Helping clients get the most out of technology to enable increased productivity, profitability, customer satisfaction and competitive advantage.

Leave a Reply