Question

Is there an easy way to get all list elements that have the same value in a column?

Let's say I have a list with a column called system.

Is there a possibility to get all items with the value "Windows" in the system column?

I could not find any parameter of Get-PnPListItem that could fit.

Was it helpful?

Solution

You can use -Query parameter to filter the list items by using CAML Query.

Reference: Get-PnPListItem Examples - Check Example 5.

Try Something like below:

$listItems = Get-PnPListItem -List YOURLISNAME -Query "<View><Query><Where><Eq><FieldRef Name='System'/><Value Type='Text'>Windows</Value></Eq></Where></Query></View>"
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top