Commands in new PS console

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of  Anonymous 1 year, 9 months ago.

  • Author
    Posts
  • #22631
    Profile photo of
    Anonymous

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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
    Profile photo of
    Anonymous

    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)

  • #22634
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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
    Profile photo of
    Anonymous

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

You must be logged in to reply to this topic.