Sunday, October 30, 2011

Create Document Library in sharepoint site Using Powershell

Leave a Comment
Execute following script in powershell to create document library in SharePoint site.

PS > $site = Get-SPSite("Site URL"); 
         $web =  $site.OpenWeb( );
         $template = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary;
         $web.Lists.Add("TestDocumentLibrary","Document Library Description",$template);
         $web.Update( );


Cheers !


0 comments: