penfold Posted June 15, 2022 Posted June 15, 2022 (edited) I am trying to review the documents in SharePoint and am trying to use a filter for files modified in the last 30 days to see what is being used. I am using the following command $Files = Get-PnPFolderItem -FolderSiteRelativeUrl $SPFolder -ItemType File |Where-Object {$_.TimeLastModified -gt $date} This does work and I get filtered files, the problem is when I check on SharePoint directly the modified time does not match the last modified time from what I see in PowerShell. The result is a number of months difference. For PowerShell I only see TimeCreated and TimeLastModified dates. Any ideas why they don't match? I have just noticed the last modified date is exactly the same for the files I find in PowerShell. This suggests it is not the actual modified date of the file, but maybe linked to something else? Edited June 15, 2022 by penfold
penfold Posted June 15, 2022 Author Posted June 15, 2022 I've just run the script to get every file modified in less than 30 days and it looks like it is getting every file. However, for most of these files it is showing the same date/time stamp. Could it be in relation to some backup running? Files that have been modified in the last 7 days are showing the same modified date as SharePoint.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now