-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add a Join-Object cmdlet to the standard PowerShell equipment #14994
Copy link
Copy link
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility moduleWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility moduleWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
As the verb-noun convention suggests, I think that there are a lot of developers looking for a common way to join objects (lists), actually it appears a decennia old quest: as shows from the PowerShell Team Join-Object article and StackOverflow issues along with: In Powershell, what's the best way to join two tables into one?
Personally, I am convinced that a
Join-Objectcmdlet will generally result in a better syntax were an object (list) join is required (in comparison with alternative cmdlets along withGroup-Object) and better performance (then using obvious iterators likeForEach-Objecttogether withWhere-Objector similar cmdlets and methods).For that reason I am maintaining a
Join-Objectscript/module for more than 3 years now. I don't think that myJoin-Objectversion should be added to the standard PowerShell package (for one thing, it is written in PowerShell and not C# 🤔), but it might serve as an example for what I would expect from a syntax that comes together with aJoin-Objectcmdlet.What do I expect from a "internal"
Join-Objectcmdlet?The syntax should be PowerShell like and include features similar to the SQL Join clause where it basically joins (a list of) objects or items based on related properties (
-Onparameter) or a simple side-by-side list join (by omitting the-Onparameter) as a specific PowerShell cmdlet feature (see:#14732) .InnerJoin,LeftJoin,RightJoin,FullJoin-On Column1, Column2HashTable) on the right object (knowing that it needs to be iterated multiple times).Also note the Linq
Join-Objectsolution by @ili101