I need to create one list with powershell with the following columns

Title Url (255 max length) Description (255 max length)

It must be a custom list. There is no need to create site columns or content type, just the list


I find it strange that you have done no basic research before posting this. Googling "create list powershell" will find you this post from heyscriptingguy, which should be what you need to get started.

PS > $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::GenericList 
PS > $spListCollection = $spWeb.Lists 
PS > $spListCollection.Add("My Generic List","Description",$listTemplate)
PS > $spList = $spWeb.Lists["My Generic List"]
PS > $spFieldType = [Microsoft.SharePoint.SPFieldType]::Text 
PS > $spList.Fields.Add("TextField",$spFieldType,$false)
  • I think you've missed a line (assigning the list to $spList), +1 though as I found your script useful. Dec 5 '12 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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