# PowerShell Script to Get a Directory Total Size

I require to get the dimension of a directory site, recursively. I need to do this on a monthly basis approximately. I intend to make a powershell manuscript to do it.

0
2019-05-04 16:37:58
Source Share

I asked the very same inquiry in stackoverflow and also I get this superb solution:

function Get-DirectorySize() {
param ([string]$root =$(resolve-path .))
gci -re $root | ?{ -not$_.PSIsContainer } |
measure-object -sum -property Length
}


This in fact generates a little a recap object which will certainly include the matter of things. You can simply order the Sum building though which will certainly be the amount of the sizes.

\$sum = (Get-DirectorySize "Some\File\Path").Sum


Thanks to JaredPad for the solution.

0
2019-05-12 11:31:27
Source

Check this post out.

0
2019-05-08 02:32:58
Source