{"id":2261,"date":"2012-07-13T15:00:00","date_gmt":"2012-07-13T15:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2012\/07\/13\/join-object\/"},"modified":"2019-02-18T13:05:37","modified_gmt":"2019-02-18T20:05:37","slug":"join-object","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/join-object\/","title":{"rendered":"Join-Object"},"content":{"rendered":"<h2><span style=\"color: #000080;font-family: arial,helvetica,sans-serif\">Problem:<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">How do I join two lists of objects into a single list? Or the equivalent: How do I join two CSV files into a single one?<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Note that joining makes sense only when the two lists or CSV files have something in common.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000080;font-family: arial,helvetica,sans-serif\">Why do we need Join?<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">If <\/span><span style=\"font-family: arial,helvetica,sans-serif\">you know why you need join would not enjoy a review of basic database concepts, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">feel free to skip this section.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Say <\/span><span style=\"font-family: arial,helvetica,sans-serif\">you own a company and want to keep track of the time when your employees <\/span><span style=\"font-family: arial,helvetica,sans-serif\">arrive. A simplified table of employees could look like this:<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"107\" colspan=\"2\">\n<p align=\"center\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Employee<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p style=\"text-align: right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Id<\/b><\/span><\/p>\n<\/td>\n<td width=\"75\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>Name<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"75\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">2<\/span><\/p>\n<\/td>\n<td width=\"75\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">3<\/span><\/p>\n<\/td>\n<td width=\"75\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Hanna<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">id uniquely identifies an employee because two employees can have the same <\/span><span style=\"font-family: arial,helvetica,sans-serif\">name. A full table would have more employees. It would also have last name, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">first name, the date the employee joined the company, and other columns.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Entrance table that contains each employee&#8217;s arrival time might look like this:<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"332\" colspan=\"2\">\n<p align=\"center\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Entrance<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p style=\"text-align: right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Employee&nbsp; Id<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">2<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">2<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">44<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">2\/29\/2012 01:00:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The &ldquo;When&rdquo; <\/span><span style=\"font-family: arial,helvetica,sans-serif\">column has both the date and the time. Types like DateTime are common for .Net <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Objects and databases.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">We can <\/span><span style=\"font-family: arial,helvetica,sans-serif\">conclude the following from the data:<\/span><\/p>\n<ol>\n<li><span style=\"font-family: arial,helvetica,sans-serif\">John <\/span><span style=\"font-family: arial,helvetica,sans-serif\">(the employee with id 1) seems to arrive early; at around 8.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif\">Mark <\/span><span style=\"font-family: arial,helvetica,sans-serif\">(the employee with id 2) is not a morning person (I like him already).<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif\">Mary <\/span><span style=\"font-family: arial,helvetica,sans-serif\">is more of a &ldquo;work from home&rdquo; kind of person. She has never entered the company <\/span><span style=\"font-family: arial,helvetica,sans-serif\">headquarters.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif\">What <\/span><span style=\"font-family: arial,helvetica,sans-serif\">about the Employee with id 44? There is no such employee in our table! And what <\/span><span style=\"font-family: arial,helvetica,sans-serif\">nefarious thing was he doing at 1:00 am on February 29? I wonder if he will be coming <\/span><span style=\"font-family: arial,helvetica,sans-serif\">back in 4 years&hellip; <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Employee <\/span><span style=\"font-family: arial,helvetica,sans-serif\">44 seems to be a mistake. Maybe the data was entered incorrectly. In some <\/span><span style=\"font-family: arial,helvetica,sans-serif\">databases, you can use &ldquo;referential integrity&rdquo; to make sure that such mistakes <\/span><span style=\"font-family: arial,helvetica,sans-serif\">never make into your table data. Obviously, this system doesn&#8217;t have a check <\/span><span style=\"font-family: arial,helvetica,sans-serif\">like that.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Wait <\/span><span style=\"font-family: arial,helvetica,sans-serif\">a minute, why do we have two tables instead of one? <\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">A simple one-table solution <\/span><span style=\"font-family: arial,helvetica,sans-serif\">might look like this:<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"332\" colspan=\"2\">\n<p align=\"center\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Employee Entrance<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Employee<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Before <\/span><span style=\"font-family: arial,helvetica,sans-serif\">throwing stones at this solution, I should say this could work for the simplest <\/span><span style=\"font-family: arial,helvetica,sans-serif\">of cases. As we are going to see below, it doesn&rsquo;t work if things get a bit <\/span><span style=\"font-family: arial,helvetica,sans-serif\">more complex, so it is not future-proof. Now, for more specific stones:<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">In <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the table above, John&rsquo;s 3 entrances and Mark&rsquo;s 2 entrances are recorded, but I <\/span><span style=\"font-family: arial,helvetica,sans-serif\">omitted the Entrance for id 44 that we used to have, because he doesn&rsquo;t have a <\/span><span style=\"font-family: arial,helvetica,sans-serif\">name. If we consider that we can have 2 Johns working for the company, we will <\/span><span style=\"font-family: arial,helvetica,sans-serif\">need an ID, as seen below. We can also have more data for each employee, like <\/span><span style=\"font-family: arial,helvetica,sans-serif\">their Last Name:<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"504\" colspan=\"4\">\n<p align=\"center\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Employee Entrance<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Id<\/b><\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p style=\"text-align: right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>First Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p style=\"text-align: right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Last Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"231\" valign=\"top\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Smith<\/span><\/p>\n<\/td>\n<td width=\"231\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Smith<\/span><\/p>\n<\/td>\n<td width=\"231\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">1<\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Smith<\/span><\/p>\n<\/td>\n<td width=\"231\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">2<\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">West<\/span><\/p>\n<\/td>\n<td width=\"231\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"41\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">2<\/span><\/p>\n<\/td>\n<td width=\"112\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"114\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">West<\/span><\/p>\n<\/td>\n<td width=\"231\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">This re<\/span><span style=\"font-family: arial,helvetica,sans-serif\">petition of first name and last name is one of the reasons we have two <\/span><span style=\"font-family: arial,helvetica,sans-serif\">tables. Having two tables allows us to have an Entrance Table, where we repeat <\/span><span style=\"font-family: arial,helvetica,sans-serif\">just the Employee Id, a small amount of data. This way, the tables can evolve <\/span><span style=\"font-family: arial,helvetica,sans-serif\">separately. If we start adding columns for Employees, like Address, Phone, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">etc., nothing changes in the Entrance table.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">There <\/span><span style=\"font-family: arial,helvetica,sans-serif\">is one more fundamental reason to have two tables. Say we want to start keeping <\/span><span style=\"font-family: arial,helvetica,sans-serif\">track of employee payments. If the employees are in the same table as their entrance, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">how do add the payments? It clearly does not fit in the same table, because <\/span><span style=\"font-family: arial,helvetica,sans-serif\">there would be multiple payments per employee and there are already multiple <\/span><span style=\"font-family: arial,helvetica,sans-serif\">employee entries for their entrances.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">proper way to express the concept of one of Employee and multiple entrances is <\/span><span style=\"font-family: arial,helvetica,sans-serif\">to have two tables. Then, it is going to be simple to add columns to the <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Employee table or add another table for their multiple payments. Another way to <\/span><span style=\"font-family: arial,helvetica,sans-serif\">say this is that a one-to-many relationship, like one employee to many payments, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">or one employee to many entrances, needs a separate table. <\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><span style=\"font-family: arial,helvetica,sans-serif\">It <\/span><span style=\"font-family: arial,helvetica,sans-serif\">turns out that problems we can easily describe conceptually can often require many <\/span><span style=\"font-family: arial,helvetica,sans-serif\">tables.<\/span><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">For <\/span><span style=\"font-family: arial,helvetica,sans-serif\">example, let&rsquo;s consider keeping track of sales at a fruit stand. That seems <\/span><span style=\"font-family: arial,helvetica,sans-serif\">simple enough conceptually, but let&rsquo;s see what is involved in this task. We <\/span><span style=\"font-family: arial,helvetica,sans-serif\">have customers, fruit (our product), and sales. Each sale receipt has one or <\/span><span style=\"font-family: arial,helvetica,sans-serif\">more lines, in which each line describes a product and its quantity. The tables <\/span><span style=\"font-family: arial,helvetica,sans-serif\">we have are:<\/span><\/p>\n<ol>\n<li>The customer table with name, delivery address, phone, etc.<\/li>\n<li>The product table with name, price, etc.<\/li>\n<li>The sales table with date and customer.<\/li>\n<li>The sale item table with the sale (id), product (id) and quantity.<\/li>\n<\/ol>\n<p>The information on a customer receipt would be gathered from all 4 tables and we would need to join this information from multiple tables.<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">If <\/span><span style=\"font-family: arial,helvetica,sans-serif\">even simple conceptual problems require many tables, joining tables becomes a <\/span><span style=\"font-family: arial,helvetica,sans-serif\">fundamental need, which brings us to the next section.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000080;font-family: arial,helvetica,sans-serif\">The different types of Joins<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Let&rsquo;s look <\/span><span style=\"font-family: arial,helvetica,sans-serif\">at our entrance data again.<\/span><\/p>\n<table style=\"width: 560px;height: 362px\" border=\"1\">\n<tbody>\n<tr>\n<td>\n<table style=\"margin-right: auto;margin-left: auto\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"50\" colspan=\"2\">\n<p align=\"center\"><b>Employee<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p style=\"text-align: right\"><b>Id<\/b><\/p>\n<\/td>\n<td width=\"75\" style=\"text-align: center\">\n<p><b>Name<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\">1<\/p>\n<\/td>\n<td width=\"75\" style=\"text-align: center\">\n<p>John<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\">2<\/p>\n<\/td>\n<td width=\"75\" style=\"text-align: center\">\n<p>Mark<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"30\">\n<p align=\"right\">3<\/p>\n<\/td>\n<td width=\"75\" style=\"text-align: center\">\n<p>Hanna<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table style=\"margin-right: auto;margin-left: auto\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"332\" colspan=\"2\">\n<p align=\"center\"><b>Entrance<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p style=\"text-align: right\"><b>Employee&nbsp; Id<\/b><\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p><b>When<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">1<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>6\/12\/2012 08:05:01 AM<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">1<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>6\/13\/2012 07:59:12 AM<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">1<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>6\/14\/2012 07:49:10 AM<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">2<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>6\/12\/2012 10:33:00 AM<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">2<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>6\/13\/2012 10:15:00 AM<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">44<\/p>\n<\/td>\n<td width=\"225\" style=\"text-align: center\">\n<p>2\/29\/2012 01:00:00 AM<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Now that <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the tables are separate and future-proof, we might want a view of the data that <\/span><span style=\"font-family: arial,helvetica,sans-serif\">joins the name and entrance date\/time for each employee. This can be done in 4 different <\/span><span style=\"font-family: arial,helvetica,sans-serif\">ways:<\/span><\/p>\n<p><strong>&nbsp;<span style=\"font-family: arial,helvetica,sans-serif\">1) Only the Employees with Entrances and Entrances with an Employee (SQL <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Inner Join)<\/span><\/strong><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">This join shows all <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the employee entrances except for the Entrance for Employee 44 that has no <\/span><span style=\"font-family: arial,helvetica,sans-serif\">corresponding Id. It also does not show a line for Hanna because there is no <\/span><span style=\"font-family: arial,helvetica,sans-serif\">entry for her in the Entrance table.<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">An example <\/span><span style=\"font-family: arial,helvetica,sans-serif\">of a SQL statement that would perform this join looks like this:<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">SELECT&nbsp;&nbsp; <b>Employee.Name<\/b>,<\/span><span style=\"font-family: arial,helvetica,sans-serif\"><b>Entrance.[When]<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">FROM&nbsp;&nbsp;&nbsp; <b>Employee<\/b><\/span><br \/><span style=\"font-family: arial,helvetica,sans-serif\"><i>INNER JOIN<\/i> <b>Entrance<\/b> ON <b>Employee.id<\/b> =<b> Entrance.EmployeeId<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><i>Select<\/i> enumerates the columns, which are <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Name from the Employee table, and When from the Entrance table. The square brackets <\/span><span style=\"font-family: arial,helvetica,sans-serif\">surrounding &ldquo;<b>[<\/b>When<b>]<\/b>&rdquo;&nbsp;<\/span><span style=\"font-family: arial,helvetica,sans-serif\">distinguish the &ldquo;When&rdquo;&nbsp; column <\/span><span style=\"font-family: arial,helvetica,sans-serif\">name from the &#8220;When&#8221; SQL command. This is required only for SQL <\/span><span style=\"font-family: arial,helvetica,sans-serif\">language keywords.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Employee is &ldquo;inner <\/span><span style=\"font-family: arial,helvetica,sans-serif\">joined&rdquo; to Entrance by the statement:&nbsp;Employee.id = Entrance.EmployeeId.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Inner Join is the <\/span><span style=\"font-family: arial,helvetica,sans-serif\">name SQL gives to this kind of join where an item appears in the result only if <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the join statement (Employee.id = Entrance.EmployeeId) is true in <strong>both<\/strong> tables <\/span><span style=\"font-family: arial,helvetica,sans-serif\">being joined. Hanna has her ID of 3, but there is no 3 in the Entrance table to <\/span><span style=\"font-family: arial,helvetica,sans-serif\">make this statement true. Employee 44 has his Entrance but there is no ID in <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the Employee table corresponding to 44 that would make the statement true.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>2) All Employees (SQL Left Outer Join)<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">This join shows all employees, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">including Hanna who has no corresponding entry in the Entrance table.<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Hanna<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p>&nbsp;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The SQL Statement looks like:<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">SELECT&nbsp;&nbsp; <b>Employee.Name<\/b>, <\/span><span style=\"font-family: arial,helvetica,sans-serif\"><b>Entrance.[When]<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">FROM&nbsp;&nbsp;&nbsp; <b>Employee<\/b><\/span><br \/><span style=\"font-family: arial,helvetica,sans-serif\"><i>LEFT OUTER JOIN<\/i> <b>Entrance<\/b> ON <b>Employee.id = Entrance.EmployeeId<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">only change in this second SQL statement is the use of &ldquo;LEFT OUTER JOIN&rdquo; <\/span><span style=\"font-family: arial,helvetica,sans-serif\">(instead of inner join).<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Left <\/span><span style=\"font-family: arial,helvetica,sans-serif\">refers to the fact that <strong>all<\/strong> elements of the left table in &ldquo;Employee LEFT OUTER <\/span><span style=\"font-family: arial,helvetica,sans-serif\">JOIN Entrance&rdquo; (which is Employee) will appear in the result. &ldquo;<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">OUTER <\/span><span style=\"font-family: arial,helvetica,sans-serif\">is in opposition to the INNER join and it allows Hanna to be listed even though <\/span><span style=\"font-family: arial,helvetica,sans-serif\">her Employee.id is not in any of the Entrance&rsquo;s EmployeeIds.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Note: <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Some SQL variants will not use &ldquo;OUTER&rdquo;.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>3) All Entrances (SQL Right Outer Join)<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">This <\/span><span style=\"font-family: arial,helvetica,sans-serif\">join has all of the Entrances, including the entry for Employee 44 even <\/span><span style=\"font-family: arial,helvetica,sans-serif\">though there is no corresponding employee Id for that in the Employee&rsquo;s table.<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">&nbsp;<\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">2\/29\/2012 01:00:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<span style=\"font-family: arial,helvetica,sans-serif\">The SQL Statement looks like:<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">SELECT&nbsp;&nbsp; <b>Employee.Name<\/b>, <\/span><span style=\"font-family: arial,helvetica,sans-serif\"><b>Entrance.[When]<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">FROM&nbsp;&nbsp;&nbsp; <b>Employee<\/b><\/span><br \/><span style=\"font-family: arial,helvetica,sans-serif\"><i>RIGHT OUTER JOIN<\/i> <b>Entrance<\/b> ON <b>Employee.id = Entrance.EmployeeId<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">only change to the previous join SQL statement is the use of &ldquo;RIGHT&rdquo; instead of <\/span><span style=\"font-family: arial,helvetica,sans-serif\">&ldquo;LEFT&rdquo;.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Right <\/span><span style=\"font-family: arial,helvetica,sans-serif\">refers to the fact that all elements of the left table in &ldquo;Employee RIGHT OUTER <\/span><span style=\"font-family: arial,helvetica,sans-serif\">JOIN Entrance&rdquo; (which is Entrance) will appear in the result. &ldquo;<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Note: <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Some SQL variants will not use &ldquo;OUTER&rdquo;.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>&nbsp;<\/b><\/span><span style=\"font-family: arial,helvetica,sans-serif\"><b>&nbsp;<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>4) All Entrances and Employees (SQL Full Join)<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">join below shows all employees and all entrances, including Employees with no <\/span><span style=\"font-family: arial,helvetica,sans-serif\">corresponding entrances (Hanna) or entrances with no corresponding employee <\/span><span style=\"font-family: arial,helvetica,sans-serif\">(the entrance for Employee 44).<\/span><\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Name<\/b><\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>When<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 08:05:01 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 07:59:12 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">John<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/14\/2012 07:49:10 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/12\/2012 10:33:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Mark<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">6\/13\/2012 10:15:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">Hanna<\/span><\/p>\n<\/td>\n<td width=\"225\">\n<p>&nbsp;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\">&nbsp;<\/p>\n<\/td>\n<td width=\"225\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">2\/29\/2012 01:00:00 AM<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The SQL Statement looks like:<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">SELECT&nbsp;&nbsp; <b>Employee.Name<\/b>, <\/span><span style=\"font-family: arial,helvetica,sans-serif\"><b>Entrance.[When]<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">FROM&nbsp;&nbsp;&nbsp; <b>Employee<\/b><\/span><br \/><span style=\"font-family: arial,helvetica,sans-serif\"><i>FULL OUTER JOIN<\/i> <b>Entrance<\/b> ON <b>Employee.id = Entrance.EmployeeId<\/b><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The <\/span><span style=\"font-family: arial,helvetica,sans-serif\">only change to the previous join the use of &ldquo;FULL&rdquo; instead of &ldquo;RIGHT&rdquo; or <\/span><span style=\"font-family: arial,helvetica,sans-serif\">&ldquo;LEFT&rdquo;.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Full <\/span><span style=\"font-family: arial,helvetica,sans-serif\">refers to the fact that all elements of both join sides (Employee and Entrance <\/span><span style=\"font-family: arial,helvetica,sans-serif\">specified in &ldquo;Employee FULL OUTER JOIN Entrance&rdquo;) will appear in the result. <\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Note: <\/span><span style=\"font-family: arial,helvetica,sans-serif\">Some SQL variants will not use &ldquo;OUTER&rdquo;.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #000080;font-family: arial,helvetica,sans-serif\">Join in Windows PowerShell<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">There is no built-in <\/span><span style=\"font-family: arial,helvetica,sans-serif\">cmdlet for joining in Windows PowerShell, so the remainder of this post will be <\/span><span style=\"font-family: arial,helvetica,sans-serif\">about building a cmdlet called Join-Object that performs the four join <\/span><span style=\"font-family: arial,helvetica,sans-serif\">operations in lists of objects in memory. Those objects can come from different <\/span><span style=\"font-family: arial,helvetica,sans-serif\">places, including csv files.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">For example, lets create a couple <\/span><span style=\"font-family: arial,helvetica,sans-serif\">of CSV files that contain the sample data we have been using:<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">@&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">Id,Name<\/span><br \/><span style=\"font-family: courier new,courier\">1,John<\/span><br \/><span style=\"font-family: courier new,courier\">2,Mark<\/span><br \/><span style=\"font-family: courier new,courier\">3,Hanna<\/span><br \/><span style=\"font-family: courier new,courier\">&#8220;@ &gt; c:\\temp\\employee.csv<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">@&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">EmployeeId,When<\/span><br \/><span style=\"font-family: courier new,courier\">1,6\/12\/2012 08:05:01 AM<\/span><br \/><span style=\"font-family: courier new,courier\">1,6\/13\/2012 07:59:12 AM<\/span><br \/><span style=\"font-family: courier new,courier\">1,6\/14\/2012 07:49:10 AM<\/span><br \/><span style=\"font-family: courier new,courier\">2,6\/12\/2012 10:33:00 AM<\/span><br \/><span style=\"font-family: courier new,courier\">2,6\/13\/2012 10:15:00 AM<\/span><br \/><span style=\"font-family: courier new,courier\">44,2\/29\/2012 01:00:00 AM<\/span><br \/><span style=\"font-family: courier new,courier\">&#8220;@ &gt; c:\\temp\\entrance.csv<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">$employee = Import-Csv c:\\temp\\employee.csv<\/span><br \/><span style=\"font-family: courier new,courier\">$entrance = Import-Csv c:\\temp\\entrance.csv<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">After running these commands, we <\/span><span style=\"font-family: arial,helvetica,sans-serif\">have:<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; $employee<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hanna&nbsp;&nbsp;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">And:<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; $entrance<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">EmployeeId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;&#8212;&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 08:05:01 AM<\/span><br \/><span style=\"font-family: courier new,courier\">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 07:59:12 AM<\/span><br \/><span style=\"font-family: courier new,courier\">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/14\/2012 07:49:10 AM<\/span><br \/><span style=\"font-family: courier new,courier\">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 10:33:00 AM<\/span><br \/><span style=\"font-family: courier new,courier\">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 10:15:00 AM<\/span><br \/><span style=\"font-family: courier new,courier\">44&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2\/29\/2012 01:00:00 AM<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">I chose CSV because you can find <\/span><span style=\"font-family: arial,helvetica,sans-serif\">data to be joined in CSV files and also because it&rsquo;s a compact way to show the sample <\/span><span style=\"font-family: arial,helvetica,sans-serif\">data.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Below are 4 calls to the Join-Object&nbsp;<\/span><span style=\"font-family: arial,helvetica,sans-serif\">that produce the equivalent of the 4 types of join.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; Join-Object -Left $employee -Right $entrance -Where {$args[0].Id -eq $args[1].EmployeeId} &ndash;LeftProperties &#8220;Name&#8221; &ndash;RightProperties &#8220;When&#8221; -Type OnlyIfInBoth<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 08:05:01 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 07:59:12 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/14\/2012 07:49:10 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 10:33:00 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 10:15:00 AM&nbsp;&nbsp;&nbsp;<\/span>&nbsp;&nbsp;&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Join-Object&rsquo;s first <\/span><span style=\"font-family: arial,helvetica,sans-serif\">two parameters are the left and right lists of objects.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The &ldquo;Where&rdquo; <\/span><span style=\"font-family: arial,helvetica,sans-serif\">parameter is the join condition, and it uses $args[0] to represent an item from <\/span><span style=\"font-family: arial,helvetica,sans-serif\">the left list and $args[1] for an item in the right list.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The RightProperties <\/span><span style=\"font-family: arial,helvetica,sans-serif\">and LeftProperties parameters are the names of the properties to appear in the <\/span><span style=\"font-family: arial,helvetica,sans-serif\">output from the left list and right list.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">The Type parameter <\/span><span style=\"font-family: arial,helvetica,sans-serif\">is one of four names: AllInLeft, AllInRight, OnlyIfInBoth and AllInBoth. I <\/span><span style=\"font-family: arial,helvetica,sans-serif\">thought those four names were simpler to relate to their functionality than <\/span><span style=\"font-family: arial,helvetica,sans-serif\">SQL&rsquo;s <i>full<\/i>, <i>inner<\/i> and <i>outer<\/i> names, <\/span><span style=\"font-family: arial,helvetica,sans-serif\">but here is a mapped correspondence:<\/span><\/p>\n<p>&nbsp;&nbsp;<\/p>\n<div align=\"center\">\n<table style=\"float: left\" border=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\"><b>Join-Object<\/b><\/span><\/p>\n<\/td>\n<td width=\"129\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><b>SQL<\/b><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">AllInLeft<\/span><\/p>\n<\/td>\n<td width=\"129\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Left Outer<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">AllIInRight<\/span><\/p>\n<\/td>\n<td width=\"129\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Right Outer<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">OnlyIfInBoth<\/span><\/p>\n<\/td>\n<td width=\"129\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Inner<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">\n<p align=\"right\"><span style=\"font-family: arial,helvetica,sans-serif\">AllInBoth<\/span><\/p>\n<\/td>\n<td width=\"129\">\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Full Outer<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Here is an example of AllInLeft:&nbsp;&nbsp;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; Join-Object -Left $employee -Right $entrance -Where {$args[0].Id -eq $args[1].EmployeeId} -LeftProperties &#8220;Name&#8221; -RightProperties &#8220;When&#8221; -Type AllInLeft<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 08:05:01 AM&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 07:59:12 AM&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/14\/2012 07:49:10 AM&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 10:33:00 AM&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 10:15:00 AM&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Hanna&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Here is the output of AllInRight:<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; Join-Object -Left $employee -Right $entrance -Where {$args[0].Id -eq $args[1].EmployeeId} -LeftProperties &#8220;Name&#8221; -RightProperties &#8220;When&#8221; -Type AllInRight&nbsp;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 08:05:01 AM&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 07:59:12 AM&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/14\/2012 07:49:10 AM&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 10:33:00 AM&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 10:15:00 AM&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2\/29\/2012 01:00:00 AM&nbsp;&nbsp;&nbsp;<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">And finally, the output of AllInBoth:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier\">PS C:\\temp&gt; Join-Object &ndash;Left $employee &ndash;Right $entrance &ndash;Where {$args[0].Id -eq $args[1].EmployeeId} &ndash;LeftProperties &#8220;Name&#8221; &ndash;RightProperties &#8220;When&#8221; -Type AllInBoth&nbsp;<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 08:05:01 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 07:59:12 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/14\/2012 07:49:10 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/12\/2012 10:33:00 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Mark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6\/13\/2012 10:15:00 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">Hanna&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2\/29\/2012 01:00:00 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><\/p>\n<h2><span style=\"color: #000080;font-family: arial,helvetica,sans-serif\">Conclusions<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Join <\/span><span style=\"font-family: arial,helvetica,sans-serif\">is an essential tool for data centric problems because, usually, multiple <\/span><span style=\"font-family: arial,helvetica,sans-serif\">tables are necessary.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\">Data <\/span><span style=\"font-family: arial,helvetica,sans-serif\">centric problems are normally handled by database tools, but if you happen to <\/span><span style=\"font-family: arial,helvetica,sans-serif\">have CSV files with this kind of data, Join-Object might be useful.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif\"><\/span>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;font-size: small\">Lucio Silveira [MSFT]<\/span><\/p>\n<h2>&nbsp;<\/h2>\n<h2><span style=\"color: #000080\">The Join-Object Script<\/span><\/h2>\n<p><span style=\"font-family: courier new,courier\">function AddItemProperties($item, $properties, $output)<\/span><br \/><span style=\"font-family: courier new,courier\">{<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; if($item -ne $null)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($property in $properties)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $propertyHash =$property -as [hashtable]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($propertyHash -ne $null)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $hashName=$propertyHash[&#8220;name&#8221;] -as [string]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($hashName -eq $null)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw &#8220;there should be a string Name&#8221;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $expression=$propertyHash[&#8220;expression&#8221;] -as [scriptblock]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($expression -eq $null)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw &#8220;there should be a ScriptBlock Expression&#8221;&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $_=$item<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $expressionValue=&amp; $expression<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | add-member -MemberType &#8220;NoteProperty&#8221; -Name $hashName -Value $expressionValue<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # .psobject.Properties allows you to list the properties of any object, also known as &#8220;reflection&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($itemProperty in $item.psobject.Properties)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($itemProperty.Name -like $property)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | add-member -MemberType &#8220;NoteProperty&#8221; -Name $itemProperty.Name -Value $itemProperty.Value<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">}<\/span><\/p>\n<p>&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">function WriteJoinObjectOutput($leftItem, $rightItem, $leftProperties, $rightProperties, $Type)<\/span><br \/><span style=\"font-family: courier new,courier\">{<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; $output = new-object psobject<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; if($Type -eq &#8220;AllInRight&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # This mix of rightItem with LeftProperties and vice versa is due to<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the switch of Left and Right arguments for AllInRight<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddItemProperties $rightItem $leftProperties $output<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddItemProperties $leftItem $rightProperties $output<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; else<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddItemProperties $leftItem $leftProperties $output<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddItemProperties $rightItem $rightProperties $output<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; $output<\/span><br \/><span style=\"font-family: courier new,courier\">}<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&lt;#<\/span><br \/><span style=\"font-family: courier new,courier\">.Synopsis<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp; Joins two lists of objects<\/span><br \/><span style=\"font-family: courier new,courier\">.DESCRIPTION<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp; Joins two lists of objects<\/span><br \/><span style=\"font-family: courier new,courier\">.EXAMPLE<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp; Join-Object $a $b &#8220;Id&#8221; (&#8220;Name&#8221;,&#8221;Salary&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">#&gt;<\/span><br \/><span style=\"font-family: courier new,courier\">function Join-Object<\/span><br \/><span style=\"font-family: courier new,courier\">{<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; [CmdletBinding()]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; [OutputType([int])]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; Param<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; (<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # List to join with $Right<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$true,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=0)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [object[]]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Left,<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # List to join with $Left<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$true,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=1)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [object[]]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Right,<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Condition in which an item in the left matches an item in the right<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # typically something like: {$args[0].Id -eq $args[1].Id}<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$true,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=2)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scriptblock]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Where,<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Properties from $Left we want in the output.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Each property can:<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # &#8211; Be a plain property name like &#8220;Name&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # &#8211; Contain wildcards like &#8220;*&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # &#8211; Be a hashtable like @{Name=&#8221;Product Name&#8221;;Expression={$_.Name}}. Name is the output property name<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; and Expression is the property value. The same syntax is available in select-object and it is <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; important for join-object because joined lists could have a property with the same name<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$true,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=3)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [object[]]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LeftProperties,<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Properties from $Right we want in the output.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Like LeftProperties, each can be a plain name, wildcard or hashtable. See the LeftProperties comments.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$true,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=4)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [object[]]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RightProperties,<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Type of join. <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; AllInLeft will have all elements from Left at least once in the output, and might appear more than once<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # if the where clause is true for more than one element in right, Left elements with matches in Right are <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # preceded by elements with no matches. This is equivalent to an outer left join (or simply left join) <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # SQL statement.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp; AllInRight is similar to AllInLeft.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp; OnlyIfInBoth will cause all elements from Left to be placed in the output, only if there is at least one<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # match in Right. This is equivalent to a SQL inner join (or simply join) statement.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp; AllInBoth will have all entries in right and left in the output. Specifically, it will have all entries<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # in right with at least one match in left, followed by all entries in Right with no matches in left, <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # followed by all entries in Left with no matches in Right.This is equivallent to a SQL full join.<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Parameter(Mandatory=$false,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position=5)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ValidateSet(&#8220;AllInLeft&#8221;,&#8221;OnlyIfInBoth&#8221;,&#8221;AllInBoth&#8221;, &#8220;AllInRight&#8221;)]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [string]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Type=&#8221;OnlyIfInBoth&#8221;<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; )<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; Begin<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # a list of the matches in right for each object in left<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $leftMatchesInRight = new-object System.Collections.ArrayList<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the count for all matches&nbsp; <\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightMatchesCount = New-Object &#8220;object[]&#8221; $Right.Count<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0;$i -lt $Right.Count;$i++)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightMatchesCount[$i]=0<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; Process<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type -eq &#8220;AllInRight&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # for AllInRight we just switch Left and Right<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $aux = $Left<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Left = $Right<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Right = $aux<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # go over items in $Left and produce the list of matches<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($leftItem in $Left)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $leftItemMatchesInRight = new-object System.Collections.ArrayList<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $null = $leftMatchesInRight.Add($leftItemMatchesInRight)<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0; $i -lt $right.Count;$i++)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightItem=$right[$i]<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type -eq &#8220;AllInRight&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # For AllInRight, we want $args[0] to refer to the left and $args[1] to refer to right,<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # but since we switched left and right, we have to switch the where arguments<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $whereLeft = $rightItem<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $whereRight = $leftItem<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $whereLeft = $leftItem<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $whereRight = $rightItem<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(Invoke-Command -ScriptBlock $where -ArgumentList $whereLeft,$whereRight)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $null = $leftItemMatchesInRight.Add($rightItem)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightMatchesCount[$i]++<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # go over the list of matches and produce output<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0; $i -lt $left.Count;$i++)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $leftItemMatchesInRight=$leftMatchesInRight[$i]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $leftItem=$left[$i]<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($leftItemMatchesInRight.Count -eq 0)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type -ne &#8220;OnlyIfInBoth&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteJoinObjectOutput $leftItem&nbsp; $null&nbsp; $LeftProperties&nbsp; $RightProperties $Type<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($leftItemMatchInRight in $leftItemMatchesInRight)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteJoinObjectOutput $leftItem $leftItemMatchInRight&nbsp; $LeftProperties&nbsp; $RightProperties $Type<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; End<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #produce final output for members of right with no matches for the AllInBoth option<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type -eq &#8220;AllInBoth&#8221;)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0; $i -lt $right.Count;$i++)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightMatchCount=$rightMatchesCount[$i]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($rightMatchCount -eq 0)<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rightItem=$Right[$i]<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteJoinObjectOutput $null $rightItem $LeftProperties $RightProperties $Type<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">&nbsp;&nbsp;&nbsp; }<\/span><br \/><span style=\"font-family: courier new,courier\">}<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: How do I join two lists of objects into a single list? Or the equivalent: How do I join two CSV files into a single one? Note that joining makes sense only when the two lists or CSV files have something in common. &nbsp; Why do we need Join? If you know why you [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Problem: How do I join two lists of objects into a single list? Or the equivalent: How do I join two CSV files into a single one? Note that joining makes sense only when the two lists or CSV files have something in common. &nbsp; Why do we need Join? If you know why you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/2261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=2261"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/2261\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=2261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=2261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=2261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}