I am trying to figure out a way to dynamically create an array from several variables inside of a powershell script.
I have several variables that will be deffined
$svr_list1 = "svrA", "svrB", "svrC"
$svr_list2 = "svrD", "svrE"
$svr_list3 = "svrF", "svrG"
$svc_list1 = "svcA", "svcB"
$svc_list2 = "svcA", "svcC"
$svc_list3 = "svcD"
I am trying to figure out some list that can pull these together into a single array but only have single groups line up so all servers in svr_list1 will only get the services in svc_list1, list 2 will line up, etc
$arry = [svrA][svcA]
[svrA][svcB]
[svrB][svcA]
[svrB][svcB]
[svrC][svcC]
[svrC][svcB]
[svrD][svcA]
[svrD][svcC]
[svrE][svcA]
[svrE][svcC]
[svrF][svcD]
[svrG][svcD]
I would like to loop this so that i can just update my original variables that are used elsewhere and then this loop would pull together the appropriate list without having to manage it twice.