Creating New Lists and Document Libraries

Administrators can combine the built-in PowerShell cmdlets with the SharePoint .NET APIs to create lists and document libraries on-the-fly. Use the following code sample:

image

The preceding sample creates three lists on a SharePoint site (“http://portal.companyABC.com/A-Project-Site”). The function New-SPList takes three parameters: Title, Description, and ListTemplateType. You must supply a unique title for a list within one site; to pass an appropriate template value, take a look at SPListTemplateType. For more information, refer to the following URL:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype(office.14).aspx ...

Get Microsoft SharePoint 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.