Oct 26 2022 04:18 AM
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 libraries and folders in the site. I have this working, apart from the issue where the Documents document library needs to be "Shared Documents" when I use Get-PnPFolderItem -FolderSiteRelativeUrl. I don't see a property in the PnpList objects that I can use for this. I looked at EntityTypeName but it needs to be parsed, or I could grab part of one of the URL properties I guess, but I was looking for a more elegant solution.
TIA
Oct 26 2022 08:46 AM
@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.
Oct 26 2022 09:00 AM
Oct 26 2022 09:20 AM
Solution@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.