Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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 > $spFieldType = [Microsoft.SharePoint.SPFieldType]::Text 
PS > $spList.Fields.Add("TextField",$spFieldType,$false)
share|improve this answer
    
I think you've missed a line (assigning the list to $spList), +1 though as I found your script useful. –  DeeMac Dec 5 '12 at 16:32
add comment

Your Answer

 
discard

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.