pnpframework
pnpframework copied to clipboard
GetRecycleBinItems will not return items from both the first and the second stage if RecycleBinItemState.None is specified
I am using the method GetRecycleBinItems of the site object to retrieve the items in the recycle bin. I pass the RecycleBinItemState.None enum value to the method and I expect that both the 1st and 2nd stage recycle bin items are returned. However, only the 1st stage recycle bin items are returned.
I've reproed this using Powershell as follows.
$items = $ctc.site.GetRecycleBinItems($null, 5000, $false, [Microsoft.SharePoint.Client.RecycleBinOrderby]::DefaultOrderBy, [Microsoft.SharePoint.Client.RecycleBinItemState]::None)
$ctc.Load($items)
$ctc.ExecuteQuery()
The returned values are those of the 1 stage only, not both stages as expected. Here a screenshot of the results using RecycleBinItemState.None
And the results using RecycleBinItemState.FirstStageRecycleBin
And the results using RecycleBinItemState.SecondStageRecycleBin
As you see the content are different and only the 1st stage is returned.
Site.GetRecycleBinItems is a CSOM method and in no way related to pnpframework. This issue should rather be raised in https://github.com/SharePoint/sp-dev-docs repo.