display two arrays elements use table

Hi

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}, `
@{Expression={$_.protocol};Label="Protocol";width=15}}

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


thanks
ang3lusAsked:
Who is Participating?
 
soostibiCommented:
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]
    }
    $i++
} | Format-Table $a

Open in new window

0
 
ang3lusAuthor Commented:
thanks very much
 A++++++++++++++++
0
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.