{"id":13,"date":"2025-07-18T09:37:37","date_gmt":"2025-07-18T07:37:37","guid":{"rendered":"https:\/\/makoto.ovh\/?p=13"},"modified":"2025-07-18T09:38:36","modified_gmt":"2025-07-18T07:38:36","slug":"lister-les-10-fichiers-les-plus-gros","status":"publish","type":"post","link":"https:\/\/makoto.ovh\/?p=13","title":{"rendered":"Lister les 10 fichiers les plus gros"},"content":{"rendered":"\n<p>Dans le monde de l&#8217;administration syst\u00e8me, identifier les fichiers les plus volumineux permet d\u2019optimiser l\u2019espace disque et d\u2019\u00e9viter les mauvaises surprises. PowerShell, avec sa puissance et sa simplicit\u00e9, offre une solution efficace pour cela.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" 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;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#ffffff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292eff;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>Get-ChildItem -Path \"VOTRE CHEMIN\" -Recurse -File | \nSort-Object Length -Descending | \nSelect-Object -First 10 | \nSelect-Object Name, @{Name=\"Taille (Mo)\"; Expression={\"{0:N2}\" -f ($_.Length \/ 1MB)}}, FullName |\nFormat-Table -AutoSize<\/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 min-light\" style=\"background-color: #ffffff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6F42C1\">Get-ChildItem<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">Path <\/span><span style=\"color: #22863A\">&quot;VOTRE CHEMIN&quot;<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">Recurse <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">File <\/span><span style=\"color: #D32F2F\">|<\/span><span style=\"color: #24292EFF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">Sort-Object<\/span><span style=\"color: #24292EFF\"> Length <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">Descending <\/span><span style=\"color: #D32F2F\">|<\/span><span style=\"color: #24292EFF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">Select-Object<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">First <\/span><span style=\"color: #1976D2\">10<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">|<\/span><span style=\"color: #24292EFF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">Select-Object<\/span><span style=\"color: #24292EFF\"> Name<\/span><span style=\"color: #D32F2F\">,<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">@<\/span><span style=\"color: #24292EFF\">{Name<\/span><span style=\"color: #D32F2F\">=<\/span><span style=\"color: #22863A\">&quot;Taille (Mo)&quot;<\/span><span style=\"color: #24292EFF\">; Expression<\/span><span style=\"color: #D32F2F\">=<\/span><span style=\"color: #24292EFF\">{<\/span><span style=\"color: #22863A\">&quot;{0:N2}&quot;<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">-f<\/span><span style=\"color: #24292EFF\"> (<\/span><span style=\"color: #1976D2\">$_.Length<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">\/<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #1976D2\">1<\/span><span style=\"color: #D32F2F\">MB<\/span><span style=\"color: #24292EFF\">)}}<\/span><span style=\"color: #D32F2F\">,<\/span><span style=\"color: #24292EFF\"> FullName <\/span><span style=\"color: #D32F2F\">|<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">Format-Table<\/span><span style=\"color: #24292EFF\"> <\/span><span style=\"color: #D32F2F\">-<\/span><span style=\"color: #24292EFF\">AutoSize<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dans le monde de l&#8217;administration syst\u00e8me, identifier les fichiers les plus volumineux permet d\u2019optimiser l\u2019espace disque et d\u2019\u00e9viter les mauvaises surprises. PowerShell, avec sa puissance et sa simplicit\u00e9, offre une solution efficace pour cela.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[4,5,3],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-powershell","tag-script","tag-taille"],"_links":{"self":[{"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/makoto.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":4,"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/makoto.ovh\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/makoto.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/makoto.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/makoto.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}