Skip to content

Instantly share code, notes, and snippets.

@aflyen
Last active March 25, 2022 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aflyen/6882a3c2e76a255de938b40dd951e626 to your computer and use it in GitHub Desktop.
Save aflyen/6882a3c2e76a255de938b40dd951e626 to your computer and use it in GitHub Desktop.
CAML Query for use with Get-PnPListItem to find all files older than a specific date in a library (https://pnp.github.io/powershell/cmdlets/Get-PnPListItem.html)
<View Scope='RecursiveAll'>
<ViewFields>
<FieldRef Name='FileLeafRef'/>
<FieldRef Name='Modified'/>
</ViewFields>
<Query>
<Where>
<Leq>
<FieldRef Name='Modified'/>
<Value Type='DateTime'>2022-03-25</Value>
</Leq>
</Where>
</Query>
</View>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment