Forum Discussion

PLove59's avatar
PLove59
Brass Contributor
Apr 16, 2021
Solved

Create a View on SharePoint Document Library Sub-Folder with PowerShell

I'm trying to create views for sub-folders in a SharePoint Online document library using SharePoint Online Management Shell. The script creates the view but does not include the files in the sub-fold...
  • AndySvints's avatar
    Apr 16, 2021

    Hello PLove59,

    If I understood you requirements correctly, you should create view first using Add-PnPView and then use Set-PnPView to set Values parameter for Recursive scope.

    Set-PnpView -List $ListName -Identity $ViewName -Values @{Scope=[Microsoft.SharePoint.Client.ViewScope]::Recursive}

    Reference

    Hope that helps.

Resources