Powershell folder size of folders without listing Subdirectories

后端 未结 10 2373
北海茫月
北海茫月 2021-01-30 21:40

I have found several resources that use the following script to get folder sizes

$colItems = (Get-ChildItem $startFolder -recurse | Where-Object {$_.PSIsContaine         


        
10条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 22:24

    Interesting how powerful yet how helpless PS can be in the same time, coming from a Nix learning PS. after install crgwin/gitbash, you can do any combination in one commands:

    size of current folder: du -sk .

    size of all files and folders under current directory du -sk *

    size of all subfolders (including current folders) find ./ -type d -exec du -sk {} \;

提交回复
热议问题