This is too long to tweet, even written as a one liner. But this will search a folder for top level subfolders and return the file usage for each. [cc lang=”PowerShell”] $folder=”S:\” dir $folder | where {$_.psIscontainer} | foreach { $stat= dir $_.fullname -recurse | Measure-Object -property length -Sum New-Object PSObject -property @{Folder=$_.FullName;Files=$stat.count;Size=$stat.Sum;}} [/cc] Again,…
Day: July 4, 2011
Get Properties with Values
One of my nuisance issues when using WMI with Windows PowerShell, is that when looking at all properties I have to wade though many that have no value. I’d prefer to only view properties that have a populated value. Here’s one way.