Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created March 22, 2018 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/f8ae283ededaf090b1f80e0187768eef to your computer and use it in GitHub Desktop.
Save shaneis/f8ae283ededaf090b1f80e0187768eef to your computer and use it in GitHub Desktop.
Inner join example
$ThingsILike = 'Coffee', 'Whiskey', 'Food', 'ToMoveItMoveIt' | ForEach-Object -Process {
[PSCustomObject]@{
Name = $_
}
}
$ThingsICanDrink = 'Coffee;$true', 'Whiskey;$true', 'Food;$false' | ForEach-Object -Process {
$Name, $CanDrink = $_ -split ';'
[PSCustomObject]@{
Name = $Name
CanDrink = $CanDrink
}
}
$JoinParams = @{
Left = $ThingsILike
Right = $ThingsICanDrink
LeftJoinProperty = 'Name'
RightJoinProperty = 'Name'
Type = 'OnlyIfInBoth'
Prefix = 'InRight_'
}
Join-Object @JoinParams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment