【发布时间】:2021-10-08 08:02:51
【问题描述】:
假设我在 powershell 中有多个非数字数组:
$a = (a, b, c, d) # $a.count equals 4 items
$b = (e, f, g, h, i, j) # $b.count equals 6 items, which is the highest count of items in one of the arrays
$c = (k, l, m, n, o) # $c.count equals 5 items
$d = (p, q) # $d.count equals 2 items
...
在声明了所有这些数组之后,我想从所有这些数组中获取最多的计数,在上述情况下,数组 $b 的计数为 6。 有没有一种简单的方法来实现这一点,而不是将每个数组与下一个数组进行比较并检查计数是否比以前高?
提前非常感谢!
【问题讨论】:
-
您只想获得最高计数吗?或者数组也需要
$b
标签: arrays windows powershell logic script