Forum Discussion
Nigel_Price9911
Aug 14, 2017Iron Contributor
How do I get all of the subfolders in a folder using PnP PowerShell
How do I use the PnP PowerShell to get all of the subfolders in a folder ?
- Joseph AckermanIron Contributor
Since you already seem to have the root folder object ($folder) that you want (and assuming that all context and what not are properly in place in your script), it probably looks something like this:
$subfolders = Get-PnPProperty -ClientObject $folder -Property Folders
...at which point you can iterate through $subfolders to do whatever you need to do.
Hope that helps.