Author Posts

February 13, 2015 at 3:11 pm

Hi Team,
I have a situation where I need to open multiple PS consoles and run the commands for different servers from my script.

Ex: When I run the main script on my powershell then based on the number of host inputs I given, those many new PS instances should auto start and start executing the specific command on each console on its own.

Please provide me a generic syntax.

February 13, 2015 at 3:20 pm

Well, we don't really have a "team," but for myself I'm wondering if you should be using jobs instead. Was there a particular criteria not to?

February 13, 2015 at 3:29 pm

hmm,
I want to execute "Test-ReplicationHealth" for several hosts which are located in different geographical locations. I cannot enable remoting and I cannot wait for rest of the hosts till its finishes one. So what I thought the above will accomplish my requirement. The reason why I want this is, the user should now the progress in window ( not sure this can be achieved by jobs)

February 13, 2015 at 3:35 pm

You can use Start-Job. It'll run locally, and do whatever your script needs to do. Just start one job per host instead of launching consoles. Way less overhead and easier to collect the results. No Remoting needed.

February 13, 2015 at 3:40 pm

Thnx. Now its time to refer "Powershell in depth" 🙂