I’ve a list called “A” in root SharePoint online site collection and it have no. of columns. One of the column, say “xyz” is type of “Hyperlink” field which contains the Sub Site URL with display text, like that I’ve total of 30 list items in the list “A”, that means total I will be having 30 sub site URL’s. And, each sub site will have the list name called “Revenue”.
Now my requirement is, I need to iterate through each entry in the list “A” of site collection, and check if the “Hyperlink” field have the site URL. If it has site URL, then I need to hide the list called “Revenue” in that particular sub site using Pnp PowerShell script.
Below is my basic code to hide the list. Could you please help on how to iterate through the list and hide the list “Revenue” if it has the site URL in the list column “xyz”?
$listName = "LIST NAME" $site = "https://CONTOSO.sharepoint.com/" Connect-PnPOnline -Url $site -UseWebLogin Set-PnPList -Identity $listName -Hidden $true