PnP Poweshell: Get-PnPListItem Restrict to a Specific View
PnP Poweshell: Get-PnPListItem Restrict to a Specific View
I'm using Get-PnpList
and Get-PnpListItem
to retrieve all items in a specific list, but I would like to restrict the items to only those in a specific view?
Get-PnpList
Get-PnpListItem
Is this possible? Maybe with a CAML query, etc..
1 Answer
1
Unfortunately, There is no direct parameter like -View
to specify your View Name
in Get-PnPListItem
-View
View Name
Get-PnPListItem
Meanwhile, as a workaround solution, you can pass the CAML Query
to the -Query
parameter based on your View setting
.
CAML Query
-Query
View setting
Ex:
Get-PnPListItem -List Tasks -Query "<View><Query><Where><Eq><FieldRef Name='GUID'/><Value Type='Title'>Qassas</Value></Eq></Where></Query></View>
Note: you can build your CAML Query by using U2U tool
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.