Compare-Object's SideIndicator property

Can someone tell me if the object outputted by Compare-Object, when using the switch PARAMETER -PassThru, contains the pretty much useful property SideIndicator?
The documentation says nothing about this; it even does not contain any information about the mentioned property.

Why don’t you give it a try?

code shorter than your post ;D

$a = 1…10;$b=1…15;compare $a $b -PassThru

I don’t give a try because I’m using an Android tablet, therefore, I have to guide me solely by the documentation, which is pretty bad BTW( otherwise I wouldn’t need to ask such question ).

As to the code shorter than my question, it is equivalent to the documentation: any person reads the explanation, and concludes it doesn’t explain what it should; it is incomplete :bangbang:

As you all spent your time writing and mine reading, maybe, you could pipe the cmdlet output to Get-Member and show the result, for the sake of completeness; maybe, you’d rather keep your post incomplete…

So the answer is ‘yes’

So you’re going to learn powershell by reading the complete documentation before execution? Good luck.

Thanks. Any other NoteProperty added by PowerShell? I hope you don’t mind this complementing question…

Again, inquiring a question in my thread? Please, start your own thread with this question, and wait some reply…

I don’t need luck, because my great understanding capacity suffices, but I do accept good luck always, why not?!

Of course I don’t mind. Nevertheless I would like to answer with a recommendation: Wait until you have access to a Windows client and start your own researches. Powershell is a fast developing universe and it is - just like all the others - partly imperfect.

It sounds for me like you try to learn swimming with reading a book. Sometime you will have to jump into the water and start swimming. :wink:

Thanks. In fact, I already swam a lot in troubled PowerShell waters, therefore, I know how bad the documentation is: many errors and invariably incomplete. In PS, the big evil is in the details ( because the docs doesn’t help ). Compare-Object is, IMO, much of the time disregarded, due to its complexity and bad doc support.
BTW, what about my extra question: any other NoteProperty added to the object passed thru by PS?

no, it will only output the difference object. no header.

PS C:\Users\Dan>
PS C:\Users\Dan> $a = 1..10;$b=1..15;compare $a $b -PassThru
PS C:\Users\Dan>

Au contraire, mon capitain! :wink: :smiley:
That’s why I recommended to do your own researches. Really often the answer to a question is ‘it depends’.
Try this when you have access to a Windows machine!

$Process_01 = Get-Process | Select-Object -First 20 | Select-Object -Property Name,ID
$Process_02 = Get-Process | Select-Object -First 40 | Select-Object -Property Name,ID
Compare-Object -ReferenceObject $Process_01 -DifferenceObject $Process_02 -PassThru

Is the entire object compared or just the name in this example?

… good point. Actually I don’t know. At least I didn’t specify. But it has the SideIndicator in the output. That’s what I wanted to show. :slight_smile:

I verified it is just the name using chrome as a process that fluctuates considerably.

I typically use $array1 | ? {$_ -notin $array2}. Just seems easier to me.

Again, a reply mimicking the docs: incomplete.
You should post the output to shed some light to this thread.
BTW, the proper way to know the elements of an object, is through the Get-Member cmdlet; so, in your code, after passing thru the Compare-Object output, pipe it to Get-Member, and copy and paste (and post) what you see in your display.

You don’t know, that’s the point.
But you already have your Windows computer, so, you only need to do some researches of your own, and (please), post the correct conclusions.

No, it is not easier.
First, because your code snippet implies you need to implement a loop to iterate thru all elements ( diff cmdlet does it automatically, thru compiled code ).
Second, you are comparing PSCustomObject’s, and FOR SURE, you’ll want to compare some property BY VALUE ( and not those objects by reference ).

It was MY point. And I am free to say my opinion. You are not the ruler of this thread - even if you started it. So calm down and get Windows machine please. You’re acting like a girl scout. :wink: :smiley:

You’re not the ruler, neither, so calm down you. You’re acting like an old master hysteric girl scout.