{"id":1153,"date":"2014-09-09T09:48:36","date_gmt":"2014-09-09T09:48:36","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1153"},"modified":"2024-04-11T12:36:56","modified_gmt":"2024-04-11T12:36:56","slug":"folder-file-size-and-timestamp-analysis-using-powershell","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/folder-file-size-and-timestamp-analysis-using-powershell\/","title":{"rendered":"Folder, File size and timestamp analysis using PowerShell"},"content":{"rendered":"<p>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\u2019t disrupt the CSV layout.<\/p>\n<pre lang=\"php\">\r\n$q = Get-ChildItem \"\\serverReserve\" -Recurse\r\n#$q | ConvertTo-Csv -NoTypeInformation | out-file \"D:DivActAnalyticsACTRDriveFoldersFiles.csv\" \r\n$q2 = $q | select PSPath,PSChildName,   PSIsContainer,BaseName,Length,Name,FullName,Extension,CreationTime,LastAccessTime,LastWriteTime \r\n \r\nforeach ($qItem in $q2)\r\n{\r\n   $qItem.PSPath = $qItem.PSPath.replace(\"Microsoft.PowerShell.CoreFileSystem::\",\"\")\r\n}\r\n \r\n$q2 | ConvertTo-Csv -NoTypeInformation -delimiter \"`t\" | out-file \"D:myFolderReport.csv\" \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019t disrupt the CSV layout. $q = Get-ChildItem &#8220;\\serverReserve&#8221; -Recurse #$q | ConvertTo-Csv -NoTypeInformation | out-file &#8220;D:DivActAnalyticsACTRDriveFoldersFiles.csv&#8221; $q2 = $q [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1155,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1153"}],"version-history":[{"count":4,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1153\/revisions"}],"predecessor-version":[{"id":1159,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1153\/revisions\/1159"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1155"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}