I would like to scan the directory src/for all .pdbfiles, but deduplicate them by their names (since the same file can appear several times in different subdirectories). I thought something like that would do.
$x = ls .\src\ -Recurse -Include *.pdb |
% { $a[$_.Name] = $_; $a } -Begin { $a = @{} }
And it's kind of like, but surprisingly $x.GetType()there is Object[]not Hashtable. Instead, each of the elements in the array Object[]is represented Hashtable.
I really don’t understand why this is happening, it seems that there $xshould beHashtable
source
share