Closed
Description
Reporting an Issue or Missing Feature
Get-PnPListItem is not honoring the RowLimit element in a CAML query. I the example below, instead of returning 5 items, it returns all 400+ items in the list. A Fiddler trace shows it's just paging the results 5 items at a time, rather than stopping after the first batch of 5 items.
$query = "
<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='SiteStatus'/>
<Value Type='Text'>Read-Only</Value>
</Eq>
</Where>
</Query>
<RowLimit>5</RowLimit>
<ViewFields>
<FieldRef Name='SiteURL' />
<FieldRef Name='SiteStatus' />
</ViewFields>
<RowLimit>5</RowLimit>
</View>"
$items = Get-PnPListItem -List "Sites" -Query $query
$items.Count # return all 436 items in the list
Expected behavior
$items.Count should only return 5 items.
Actual behavior
$items.Count return 436 items.
Steps to reproduce behavior
See above
What is the version of the Cmdlet module you are running?
1.11.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify