I want to list the all the files that were created, or modified in a given month in a SharePoint Online library. I would like to further recursively include any files in folders ( but excluding the folders themselves). There are a few issues with the (get-PnPListItems) query below
1) it doesn't work! It brings all the files in my test root library that were created yesterday.
$query = ` "<View><Where> ` <And>` <Geq>` <FieldRef Name='Modifed' /> <Value IncludeTimeValue='FALSE'` Type='DateTime'>01/04/2017 12:00:00 AM</Value> ` </Geq> ` <Leq> ` <FieldRef Name='Modifed' /> ` <Value IncludeTimeValue='FALSE' Type='DateTime'>01/05/2017 12:00:00 AM</Value> ` </Leq> ` </And> ` </Where></View>"
2) I ideally want to use variable parameters for the start and end dates I am thinking of this and adding days to get the following on the range. However, I guess this could be improved upon.
$startDate = [Datetime]::new(2017,04,01)