creating list of values that match in two arrays

I’ve two arrays: $Networks and $DrNetworks. Each contains the Sql Server name and database name for each database that each server hosts. I want to create an array that hosts each source server & source database, ie Network, and it’s corresponding DR Server & Dr database, ie DrNetwork.

How can I do that?

 

eg:

$Networks contains

SqlServer1 Db1

SqlServer2 Db2

SqlServer3 Db3

$DrNetworks contains

DrSqlServer9 Db1

DrSqlServer8 Db2

DrSqlServer7 Db3

I want to create an array that has

SourceServer SourceDb DrServer DrDb
SqlServer1 Db1 DrSqlServer9 Db1
SqlServer2 Db2 DrSqlServer8 Db2
SqlServer3 Db3 DrSqlServer7 Db3

So basically you need a custom object with SourceServer, SourceDb, DrServer and DrDb as headers in tabular form ?

Answered here: https://powershell.org/forums/topic/creating-an-array-with-matching-values-form-two-other-arrays/