Forum Discussion
stromnessian
Oct 26, 2022Brass Contributor
PowerShell PnP "Shared Documents"
Hi The answer to this is probably staring me in the face, and will be trivial to many on this forum I suspect. I want to create a list using PnP PowerShell, with items based on document librarie...
- Oct 26, 2022
stromnessian You can use this PowerShell:
$lists = Get-PnPList -Includes RootFolder $lists.RootFolder.NameThis will give you the correct name of document library.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
stromnessian
Oct 26, 2022Brass Contributor
To clarify:
Step 1. is to find all document libraries using Get-PnpList.
Step 2. is to, for each of the above, find all top level folders using Get-PnPFolderItem -FolderSiteRelativeUrl.
I initially used the Title property of the lists found in 1., but this doesn't work for "Shared Documents" as the title is "Documents".
Step 1. is to find all document libraries using Get-PnpList.
Step 2. is to, for each of the above, find all top level folders using Get-PnPFolderItem -FolderSiteRelativeUrl.
I initially used the Title property of the lists found in 1., but this doesn't work for "Shared Documents" as the title is "Documents".
ganeshsanap
Oct 26, 2022MVP
stromnessian You can use this PowerShell:
$lists = Get-PnPList -Includes RootFolder
$lists.RootFolder.Name
This will give you the correct name of document library.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- stromnessianOct 26, 2022Brass Contributor
Awesome, thanks ganeshsanap!