我有一个从这样的数组创建的哈希表:
$employeesHashtable = $employees | Group-Object -Property Initials -AsHashTable
如何查找具有多个值的键?
最佳答案
使用 .GetEnumerator()
的替代方法可以使用哈希表 Keys , key 集合实现 ICollection
并且可以毫无问题地枚举:
$keysWithMultipleValues = $employeesHashtable.Keys.where{ $employeesHashtable[$_].Count -gt 1 }
关于powershell - 如何在 powershell 中识别具有多个值的哈希表键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72451122/