$source = @{}
gci | %{$source.Add($_.FullName,$_)}
$source.getEnumerator() | %{($_.value).PsIsContainer}
Does not get me anywhere; but
gci | % {$_.PsIsContainer}
Does
I have resorted to using
$source.getEnumerator() | %{
if ((($_.Value).Attributes).toString() -eq "Directory")
{
...
}
}
Which seems kind of clunky
Why is it that PsIsContainer doesn’t work on HashTable Values?
It does work for me when I use a more direct method of adding items to the table, though:
This seems to be an artifact of using the
Addmethod for putting things in the hashtable.