iRon7 / Join-Object

Combines two objects lists based on a related property between them.
MIT License
107 stars 13 forks source link

how to use where keyword #31

Closed ericxin1982 closed 2 years ago

ericxin1982 commented 2 years ago

HI @iRon7

Thanks for doing the good job to make this module be available. I am wondering how to use where keyword, there is no example available, sorry to bother you.

Thanks Eric Xin

iRon7 commented 2 years ago

Hello Eric,

I don't think the -Where parameter is used much as it is quiet similar to just piping the result to the Where-Object cmdlet. Yet there is a minor difference as it lets you access to properties of the $Left and $Right prior they where merged. Meaning you might do something like -On Name -Where { $Left.Id -gt $Right.Id } which will than only pass the objects where the Name properties are equal and the Id at the left side is greater than the Id at the right side. There are also a few examples in the pester test script.

ericxin1982 commented 2 years ago

Thanks so much!