display two arrays elements use table


I created two simple arrays of string
for example:
$users = {"James","Michelle","George","Louis", ...etc}
$manager = {"Sarah","Jessica","Bill","William", ...etc}

for objects in powershell
is possible to use table like
$a = @{Expression={$_.Name};Label="Name";width=50}, `

get-process | Format-able $a

i tried use this with normal array but i can't  figure out how i can do this
i would like to display array elements like this
                      Users                                                   Managers
                   ++++++++                                              +++++++++
                      James                                                   Sarah
                     Michelle                                                 Jessica
                     George                                                   Bill
                       Louis                                                    William

Who is Participating?
Here you are:

$users = @("James","Michelle","George","Louis")
$manager = @("Sarah","Jessica","Bill","William")

$a = @{Expression={$_.Users};Label="Users";width=50}, @{Expression={$_.Managers};Label="Managers";width=15}

$users | ForEach-Object {$i=0} {
    New-Object -TypeName PSObject -Property @{
        Users = $_
        Managers = $manager[$i]
} | Format-Table $a

Open in new window

ang3lusAuthor Commented:
thanks very much
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.