Forum Discussion
File explorer - searches
You can try using a script like this in PowerShell, then working with the CSV file it creates in Excel to find the data you need. It won't have everything you asked for, but should give you some data to work with. Hope that helps!
Get-ChildItem C:\Users\<user>\Documents | Select Name, LastWriteTime, LastAccessTime | Export-Csv -Path C:\Users\<user>\Documents\FileList.csv -NoTypeInformation
I seem to have a problem with the naming of my folders - PowerShell doesn't accept folders with "-" in the name. Anyway to solve this?
- Micah HibdonJun 12, 2018Brass Contributor
That is interesting, I don't think PowerShell should have issues with a "-" in the name. I did notice that I didn't allow for that script to search down below the one level of the folder you list by name. You can add the "-recurse" parameter to the command to search all levels below just the top level. Hope this helps!
Here's the updated code:
Get-ChildItem C:\Users\<user>\Documents -recurse | Select Name, LastWriteTime, LastAccessTime | Export-Csv -Path C:\Users\<user>\Documents\FileList.csv -NoTypeInformation