是否有允许从 Powershell 中的多维数组中检索单列的函数、方法或语言构造?
$my_array = @()
$my_array += ,@(1,2,3)
$my_array += ,@(4,5,6)
$my_array += ,@(7,8,9)
# I currently use that, and I want to find a better way:
foreach ($line in $my_array) {
[array]$single_column += $line[1] # fetch column 1
}
# now $single_column contains only 2 and 5 and 8
我的最终目标是从一列中找到不重复的值。