JuanC Posted January 27, 2007 Report Share Posted January 27, 2007 $items = get-childitem $args foreach($item in $items) { if ($item -is [system.IO.DirectoryInfo]) { $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Folder -value $item add-member -inputobject $obj -membertype ScriptProperty -Name Length -value { $elem = get-childitem $this.Folder.FullName -include *.* -recurse | measure-object -sum length; if ($elem -eq $null) {return 0;} else {return $elem.Sum;} } write-output $obj }}See this post for information on using this script and powergadgets drilldown JuanC Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.