Commands in new PS console

This topic contains 4 replies, has 2 voices, and was last updated by  Anonymous 3 years, 1 month ago.

  • Author
  • #22631


    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.

  • #22632

    Don Jones

    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?

  • #22633


    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)

  • #22634

    Don Jones

    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.

  • #22635


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

You must be logged in to reply to this topic.