SOLVED

Create multiple SharePoint Document libraries with Power Shell or Power Automate

Brass Contributor

Hello All,

 

I was wondering if there is/are any ways to create a bulk/multiple SharePoint document libraries or list with Power Shell or Power Apps using .csv file.

 

Looking forward to hearing from you.

 

Thank you all.

6 Replies

@Naligurtan 

 

You can use below script from PnP script samples:

 

https://pnp.github.io/script-samples/spo-add-multiple-lists-using-csv-file/README.html?tabs=pnpps 

 

Above script support to create list and library both.

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

 

 

Thanks @kalpeshvaghela,
In this case, the columns for this file(ListsAndLibraries.csv) will be:
Title| | Url || PnP Library || DocumentLibrary ||
#Path to CSV file
$csvFilePath = "ListsAndLibraries.csv"

Am i right?

Thanks again.

@Naligurtan 

 

Format of CSV Library is given in same link i.e. https://pnp.github.io/script-samples/spo-add-multiple-lists-using-csv-file/README.html?tabs=csv 

 

Let's say you want to create two document library with following details

 

Library 1

  • Library Url: ProjectDocuments
  • Library Title: Project Documents

Library 2

  • Library Url: ContractDocs
  • Library Title: Contract Documents

Then you csv file should be as below:

 

Title;Template;Url
Project Documents;DocumentLibrary;ProjectDocuments
Contact Documents;DocumentLibrary;ContractDocs


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

 

 

Thanks @kalpeshvaghela for providing me extra information.
What I want to understand is this:
How this file looks like ListsAndLibraries.csv
Please see the attached image/screenshot. Is going to look something shown on the excel screenshot?
ThanksListsAndLibrariescsv.png

best response confirmed by Naligurtan (Brass Contributor)
Solution

@Naligurtan 

 

It should look like as below:

 

kalpeshvaghela_0-1661330070657.png

 

And make sure that you update below link script based on which separator you are using in csv file either semi-colon (;) or colon (,).

 

 

kalpeshvaghela_1-1661330174473.png

kalpeshvaghela_2-1661330209715.png

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

1 best response

Accepted Solutions
best response confirmed by Naligurtan (Brass Contributor)
Solution

@Naligurtan 

 

It should look like as below:

 

kalpeshvaghela_0-1661330070657.png

 

And make sure that you update below link script based on which separator you are using in csv file either semi-colon (;) or colon (,).

 

 

kalpeshvaghela_1-1661330174473.png

kalpeshvaghela_2-1661330209715.png

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

View solution in original post