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) $b = @(2, 3, 1) if (compare -ReferenceObject $a -DifferenceObject $b) { echo "Output expected" }
我希望脚本输出字符串,因为两个数组的元素顺序不同。
你的问题不是很清楚。但你可以做一个:
Compare-Object $a $b -SyncWindow 0
在这里查看一些解释。