1

I want to compare two CSV files to see if they are different. I was thinking I could do that with Compare-Object, but that doesn't seem to work.

$csvA = ConvertFrom-CSV "A,B,C`n1,1,1`n1,1,1"
$csvB = ConvertFrom-CSV "A,B,C`n1,1,1`n1,1,2"
Compare-Object $csvA $csvB

There is no output on the last line. Why is that?

1 Answer 1

4

Yes, Compare-Object got me at first also...

Try it like this:

Compare-Object $csvA $csvB -Property A,B,C
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.