Basically I've written scripts to create users on a domain. I had problems using New-PSDrive commands on the parent domain, connecting to chiild domains. So I ended up, depending on what domain the user selects then the script determines the correct DC for that domain to run it on.
In a perfect world, I'd like for this to loop for each domain selected. So if test and dev were selected then it would loop twice, connecting to the correct DC each time. I've seen blogs on loops and foreach workflows, but those have me confused. The powershell code is the same accross the domains, it's just the DC it connects to that changes.