I have two arrays filled with strings that are relational. I need to pull back the value from array 2 whilst iterating through array 1 in a foreach loop. How your i Achieve this? Here is my code:
$contracts = @("xytt"
"deff"
"mnoo")
$labels = @("London contract"
"Dubai contract"
"Glasgow contract")
foreach ($contract in $contracts){
#Do stuff with $contract
#Return label associated to contract object
}
$contracts, how do I know which item in$labelsit is related to? Unless you are stuck with this arrangement of data for some reason, I'd consider setting it up a different way.