Hello everyone,
I have many subsites and I would like to target only one using below but it does not seem to work. Is there another way to filter? Thanks.
Get-PnPSubWebs -Recurse | Where-Object ($_.ServerRelativeUrl -contains "/sites/main/site1")
Hello everyone,
I have many subsites and I would like to target only one using below but it does not seem to work. Is there another way to filter? Thanks.
Get-PnPSubWebs -Recurse | Where-Object ($_.ServerRelativeUrl -contains "/sites/main/site1")
Hi @TanHuynh-3201,
You need to use braces { } instead of Parentheses ( ), like the below.
Get-PnPSubWebs -Recurse | Where-Object {$_.ServerRelativeUrl -contains "/sites/main/site1"}
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
5 people are following this question.
Hide lists for the Sharepoint site: Limit access to PowerApps only
Sharepoint Online Search error with CSOM
Sharepoint online - copy files programmatically
Sharepoint - Unable to Filter Views Based On Responsible Party (Email)
Error deploying SPFx Library component solution package with webApiPermissionRequests