title: How to get a unique output with the results of two cmdlets (get-printer and get-printerport)?
body: <p>I need to export a list of printers to a file. It must contain values like Name,  DriverName and so on from Get-Printer, but also the value PrinterHostAddress from the cmdlet Get-PrinterPort. I think the value 'Name' from both cmdlets can be used as a key to make the union.
  I've tried things like :</p>
  
  <pre><code>$a = get-printer
  $b = get-printerport
  Compare-Object $a $b -PassThru -IncludeEqual | Select Name, Comment, Location, DriverName, PrinterHostAddres
  </code></pre>
  
  <p>But it is not working.</p>
  
  <p>I know, I can do it in two steps and copy/paste, but I would like to learn how to do it in one step.</p>