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" }
2 つの配列の要素の順序が異なるため、スクリプトが文字列を出力することを望みます。
あなたの質問はあまり明確ではありません。しかし、次のことができます。
Compare-Object $a $b -SyncWindow 0
ここでいくつかの説明を参照してください。