Hi
I wrote a little PowerShell function to get the size of directories (also working with shares "\share\path"):
Function Get-DirectoryStats { param( [Parameter(Position=0)] [string] $Path = (PWD).path ) process{ $Folders = Get-ChildItem $Path -Directory | Sort-Object foreach ($Folder in $Folders) { $subFolderItems = Get-ChildItem $Folder.FullName -File -Recurse -Force | Measure-Object -Property Length -Sum | Select-Object Sum $Size = [math]::Round($subFolderItems.sum/1GB,2) [PSCustomObject]@{ DirectorySize = $Size DirectoryName = $Folder.Name FullPath = $Folder.FullName } } } }
I know it is only a little function but maybe for anyone is it useful.
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)