PowerShell Script to Get a Directory Total Size

后端 未结 4 1355
情话喂你
情话喂你 2021-02-05 09:45

I need to get the size of a directory, recursively. I have to do this every month so I want to make a PowerShell script to do it.

How can I do it?

4条回答
  •  粉色の甜心
    2021-02-05 10:26

    Here's quick way to get size of specific file extensions:

    (gci d:\folder1 -r -force -include *.txt,*.csv | measure -sum -property Length).Sum
    

提交回复
热议问题