View Single Post
Old 08-14-2007   #8 (permalink)
Keith Hill [MVP]


 
 

Re: stoopid newb question

"tonyr" <tonyr@discussions.microsoft.com> wrote in message
news:F9E889E6-E7D7-48F1-989D-7FD096B1CF5C@microsoft.com...
> dangit I tried something very similar not sure why it did not work! thanks
> very much
>
> "RichS" wrote:
>
>> this would work
>>
>> PS> ls c:\ -rec | where{$_.mode -like "d*"} | foreach{ $size =
>> $di.getfolder($_.fullname).size/1mb; Write-Host $_.fullname $size }


BTW I would recommend using the PSIsContainer property to filter out
directories e.g.:

gci c:\ -r | ?{$_.PSIsContainer} | %{"{0} {1} MB" -f $_.fullname,
($di.getFolder($_.fullname).size/1MB)}

--
Keith

My System SpecsSystem Spec