I have two objects $A & $B that each contain a CSV import.
Within both objects two columns exist that share the same property name (`DisplayName` & `LoginName`). First of all, I want to combine those and at some point within my script pipe them to `Out-GridView`.

Unfortunately, I can't seem to find a way to do that.

```
$A = Import-csv -Path "C:\Users\[...]" | Where-Object {$_.LoginName -like "*[...]*"} | Sort DisplayName
$B = Import-csv -Path "C:\Users\[...]" | Where-Object {$_.LoginName -like "*[...]*"} | Sort DisplayName

$displayNames = ($A.DisplayName) + ($B.DisplayName)
$loginNames = ($A.UserPrincipalName) + ($B.LoginName)

```

Now, at this point I can't use both `$displayNames` and `$loginNames` and simultaneously pipe them to `Out-GridView`.

I was thinking of combining the two objects but doing `$displayNames + $loginNames` results in an object that doesn't maintain the two properties.

Then I thought I could create a pscustomobject like so:

```
$combined = [pscustomobject] @{
DisplayNames = $displayNames
LoginNames = $loginNames
}

```

However, if I piped this into `Out-GridView` it would show me the two columns `DisplayNames` and `LoginNames` but all the values would be within an array so the output would only display one line.

Then I tried to convert both arrays into strings like so:

```
$combined = [pscustomobject] @{
DisplayNames = ($displayNames | Out-String)
LoginNames = ($loginNames | Out-String)
}

```

This time, I was almost there. `Out-GridView` indeed shows the expanded values in the two columns. Unfortunately, they could not be selected with the mouse anymore.

This is what it looks like:

[![enter image description here](https://i.stack.imgur.com/qfvFa.png)](https://i.stack.imgur.com/qfvFa.png)

What should I be doing differently?