Forum Discussion
Anonymous
May 29, 2018File explorer - searches
I am preparing to move a complete document library from a network drive to OneDrive and SharePoint, but before I can do that, I would like to clean up old files. In my folders there are more than 10...
Anonymous
Jun 06, 2018Thanks. I will try this.
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?
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 Hibdon
Jun 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