Forum Discussion
PowerShell PnP "Shared Documents"
- 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 Are you trying to get the name of document library ("Shared Documents") in library URL dynamically?
Try using Get-PnPList command if it helps you.
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.
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".
- ganeshsanapOct 26, 2022MVP
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.
- stromnessianOct 26, 2022Brass Contributor
Awesome, thanks ganeshsanap!