Saturday 5 November 2016

Create List/Library


Today I am providing the Power Shell Script that will create a new list/library on the bases of given custom template on the given site/subsite.

Inputs
Site URl - Url Where You want to create list
Title - Name of the List
Description - Description of the List
List Template - Template that will be used for creating the list

Outputs
This script will create a new list/library on the bases of given template and given url.

Example-
.\scriptname.ps1
.\scriptname.ps1 | out-file “FilePath\Filename.txt”

Dependencies -
For executing this script user must be added in site collection administrators given site.
User should have Shell Admin rights to run the scripts.
Run Management Shell as an Administrator. 
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Management Shell.
Follow on screen instructions.

FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.
https://drive.google.com/file/d/0BznVpoE_ln0ANWU2dG9saUl0SkU/view?usp=sharing
Go to above link to get the script.
This script can be used when a template is uploaded in the site and is hidden from Add new list page.

No comments:

Post a Comment