在Powershell中也有数组,有两种方式生成一个数组 $results = [System.Collections.ArrayList]::new()$res = [System.Collections.ArrayList]@()$arr = @()$results.Add(1) 第一个方式通过调用.Net中的库实现,性能更好第二个方式是Powershell本身的数组