如何从PowerShell数组中删除重复项?
$a = @(1,2,3,4,5,5,6,7,8,9,0,0)
如何从PowerShell数组中删除重复项?
$a = @(1,2,3,4,5,5,6,7,8,9,0,0)
$a = @('D:/', 'two', 'three')
$s = "D:/"
$null -ne ($a | ? { $s -match $_ }) # Returns $true
这里可以使用另一种解决方案,欢迎您尝试
$data = Get-Content $file |
ConvertFrom-Json |
Select-Object -Property id, name, streetName1, zipCode, city |
Sort-Object -Property id -Unique