{"id":901,"date":"2021-07-27T15:55:53","date_gmt":"2021-07-27T15:55:53","guid":{"rendered":"https:\/\/techno.slomka.biz\/?p=901"},"modified":"2026-03-10T17:01:06","modified_gmt":"2026-03-10T17:01:06","slug":"powershell-tipp-alle-dateien-groser-als-x-byte-in-einer-verzeichnisstruktur-finden","status":"publish","type":"post","link":"https:\/\/techno.slomka.biz\/?p=901","title":{"rendered":"\ud83d\udca1Powershell Tip &#8211; Find all files larger than X bytes in a directory structure"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In order to output all files larger than a certain size on Windows systems, you do not have to use the explorer search. A Powershell script does this very efficiently.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#282a36\"><span style=\"background:#ebebe6;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#282a36\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># 100 MB\n$min_file_size = 100000000\n\nGet-ChildItem -Recurse -File | Where-Object { $_.Length -ge $min_file_size }  | Select Fullname, Length | Out-GridView<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #7B7F8B\"># 100 MB<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">$min_file_size <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">100000000<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #97E1F1\">Get-ChildItem<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">Recurse <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">File | <\/span><span style=\"color: #97E1F1\">Where-Object<\/span><span style=\"color: #F6F6F4\"> { <\/span><span style=\"color: #BF9EEE\">$_<\/span><span style=\"color: #F6F6F4\">.Length <\/span><span style=\"color: #F286C4\">-ge<\/span><span style=\"color: #F6F6F4\"> $min_file_size }  | Select Fullname, Length | <\/span><span style=\"color: #97E1F1\">Out-GridView<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The result is shown in a gridview window:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"352\" src=\"https:\/\/techno.slomka.biz\/wp-content\/uploads\/2021\/07\/PS_Sizes01-1024x352.jpg\" alt=\"\" class=\"wp-image-902\" srcset=\"https:\/\/techno.slomka.biz\/wp-content\/uploads\/2021\/07\/PS_Sizes01-1024x352.jpg 1024w, https:\/\/techno.slomka.biz\/wp-content\/uploads\/2021\/07\/PS_Sizes01-300x103.jpg 300w, https:\/\/techno.slomka.biz\/wp-content\/uploads\/2021\/07\/PS_Sizes01-768x264.jpg 768w, https:\/\/techno.slomka.biz\/wp-content\/uploads\/2021\/07\/PS_Sizes01.jpg 1273w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">GridView Ausgabefenster<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If the last part <code>| Out-GridView<\/code> is omitted, the output in the console is required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to output all files larger than a certain size on Windows systems, you do not have to use the explorer search. A Powershell script does this very efficiently. The result is shown in a gridview window: If the last part | Out-GridView is omitted, the output in the console is required.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[78],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-powershell"],"_links":{"self":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=901"}],"version-history":[{"count":4,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/901\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/901\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}