Powershell folder size of folders without listing Subdirectories

后端 未结 10 2223
北海茫月
北海茫月 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条回答
  •  梦毁少年i
    2021-01-30 22:36

    This simple solution worked for me as well.

    powershell -c "Get-ChildItem -Recurse 'directory_path' | Measure-Object -Property Length -Sum"
    

提交回复
热议问题