SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code to create a list, however I need to increase via powershell the maxlength of one column

$spWeb = Get-SPWeb -Identity http://ost-dev1.ciredev1.local
 $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::GenericList 
 $spListCollection = $spWeb.Lists 
 $spListCollection.Add("ExternalSites","External Sites",$listTemplate)
 $spList = $spWeb.GetList("/Lists/ExternalSites")
 $spFieldType = [Microsoft.SharePoint.SPFieldType]::Text 
 #$spList.Fields["ExtSiteUrl"].Title = "External Site Url"
 #$spList.Fields["ExtSiteDescription"].Title = "External Site Description"

share|improve this question
up vote 5 down vote accepted

Do you try to use something like this?

$spField = $spList.Fields["FieldName"]
$spTextField = $spField -as [Microsoft.SharePoint.SPFieldText]
$spTextField.MaxLength = 128
share|improve this answer
it doesnt work with text fields, apparently the field text is only maximum 255 chars, when I changed to Note, it works pretty well. – Esteban V Mar 5 '12 at 10:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.