In just a few lines, one can generate a CSV of all files and their attributes including size and timestamp. I prefer to use TSV (tab delimited) to ensure embedded characters like quotes or commas don’t disrupt the CSV layout.
$q = Get-ChildItem "\serverReserve" -Recurse #$q | ConvertTo-Csv -NoTypeInformation | out-file "D:DivActAnalyticsACTRDriveFoldersFiles.csv" $q2 = $q | select PSPath,PSChildName, PSIsContainer,BaseName,Length,Name,FullName,Extension,CreationTime,LastAccessTime,LastWriteTime foreach ($qItem in $q2) { $qItem.PSPath = $qItem.PSPath.replace("Microsoft.PowerShell.CoreFileSystem::","") } $q2 | ConvertTo-Csv -NoTypeInformation -delimiter "`t" | out-file "D:myFolderReport.csv" |
Want to talk?
Drop us a line. We are here to answer your questions 24*7.