Forum Discussion
Daniel Westerdale
Aug 07, 2019Iron Contributor
Using Get-PnPListItem without the dreaded ViewTheshold Errors
I am having to deal with a large number of Recycle Bin Items. Title Id ItemType LeafName DirName
----- ...
- Aug 08, 2019
With a bit of lateral thinking .....I rewrote the code the finds the file . No recursive query = no view threshold errors! Rock and Roll.
$fileFolderItem = Get-PnPFolderItem -FolderSiteRelativeUrl $DirectoryRelativePath -ItemName $Filename $fileFolderItem.Context.Load($fileFolderItem.ListItemAllFields) $fileFolderItem.Context.ExecuteQuery() # now i can do what intended to do.. ($fileFolderItem.ListItemAllFields).SetComplianceTag(......
Daniel Westerdale
Aug 08, 2019Iron Contributor
With a bit of lateral thinking .....I rewrote the code the finds the file . No recursive query = no view threshold errors! Rock and Roll.
$fileFolderItem = Get-PnPFolderItem -FolderSiteRelativeUrl $DirectoryRelativePath -ItemName $Filename
$fileFolderItem.Context.Load($fileFolderItem.ListItemAllFields)
$fileFolderItem.Context.ExecuteQuery()
# now i can do what intended to do..
($fileFolderItem.ListItemAllFields).SetComplianceTag(......
TDI_Daniel
Dec 06, 2023Copper Contributor
For those reading this later on, query and pagesize together will not work.
$fileItem = Get-PnPListItem -List $Library -Query $query -PageSize 4000
will still prompt for the result limit of 5000
Do this in stead:
$fileItem = Get-PnPListItem -List $Library -PageSize 4000
without the query, and filter the results later.
$fileItem = Get-PnPListItem -List $Library -Query $query -PageSize 4000
will still prompt for the result limit of 5000
Do this in stead:
$fileItem = Get-PnPListItem -List $Library -PageSize 4000
without the query, and filter the results later.