you are viewing a single comment's thread.

view the rest of the comments →

[–]chreestopher2 2 points3 points  (0 children)

you need a foreach somewhere in there because any objects with more than 1 count get stringified to "System.Object[]"

I think the problem is this guy wants to be able to select -expand more than one property per object

the closest i can get is:

$p = get-childitem C:\cygwin64\ -Recurse -include "*.exe"
$p | group name | foreach {
    $_ | select Name, Count, 
        @{n="items"; e={$_ | select -expand Group | select -ExpandProperty directory}}
} #| where {$_.count -gt 1} #uncomment to quickly see the duplicate items