Hi Danny,
I recommend managing multiple 7-mode controllers using the following technique:
# Declare an array where we will store 7-Mode controller connections.
$7modeControllers = @()
# Connect to our controllers and store them in our array (assumes that
# credentials are cached). You could connect to many controllers here.
$7modeControllers += Connect-NaController 192.168.2.8 -Transient
$7modeControllers += Connect-NaController 192.168.2.6 -Transient
# Iterate through the 7-mode controllers we connected to and retrieve a
# list of aggregates from them.
foreach ($controller in $7modeControllers) {
# use the global variable to identify the current controller.
$global:CurrentNaController = $controller
# Now every other command you run will use the current controller.
Get-NaSnapMirror
}
This approach allows you to do your work on each controller in a single loop no matter how many controllers you are managing. You essentially perform the task as if you're using a single controller inside the foreach loop. It's also a nice approach because you can work out your logic for one controller and then just drop it into the loop to scale it out, and you don't need to build up collections of objects in variables for processing, other than the connected controller collection of course.
Kirk out.