title: PowerShell - How to format the output of two distinct commands in one table?
body: <pre><code>Foreach($a In Get-GPO -All) { Foreach($b In $a | Get-GPPermissions -TargetName "Domain Admins" -TargetType Group) { $a.DisplayName; $b.Trustee.Name; $b.Permission } }
  </code></pre>
  
  <p>I use the command to output all GPO permission for Domain admins group. And by default Get-GPPermissions result does not include GPO name field. So I combine Get-GPO and Get-GPPermissions result to output GPO Name, Group Name and Permission. I need to output below sample. How to design my code?</p>
  
  <pre><code>GPO Name                   Group Name        Permission
  ---------                  -----------       -------------
  Default Domain Policy      Domain Users      GpoEditDeleteModifySecurity
  </code></pre>