Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下数组 $a = 1,2,3,4,5 $b = 2,3
现在,我可以从 $a 中删除 $b 的内容,以便 $a 的输出为:1,4,5
在此先感谢马特
您可以比较集合并将结果保存回 $a:
$a = 1,2,3,4,5 $b = 2,3 $a = compare $a $b -PassThru $a 1 4 5