I have an array with the following values:
| Firstname | Lastname | Username |
|-----------|------------------|----------|
| person1 | person1_lastname | p1 |
| person2 | person2_lastname | p2 |
| person3 | person3_lastname | p3 |
| person4 | person4_lastname | p4 |
This is the code that produces the above results:
$finalUsers = foreach($person in $excludedUsers) {
if ($person.Username -notin $ausLunchJobs.AssigneeUser -and $person.Username -notin $ausLunchJobs.AssigneeUser2) {
$person | Select-Object Firstname, Lastname, Username
}
}
I want to split that array into two columns and pair the Username data together.
Ideal output:
| Username | Username2 |
|----------|-----------|
| p1 | p2 |
| p3 | p4 |
Any guidance on how I can achieve something like this?
TIA