More theory issue ...
I have a powershell script that exists on three servers. There are three servers in this example:
I am using another server4 machine to invoke the script C: \ ExampleScript.ps1 remotely using Invoke-Command , indicating the remote machine using the ComputerName parameter. The ultimate goal of the script is to determine if powershell is working, if it is not, then the computer is "not busy" and can open a script that is called remotely. If the computer is busy, go to the next server and continue working through three machines until all the parameter values are exhausted. If all the machines are busy, it would be ideal if there was a way to periodically check the processes and see if they are all open. Thus, script execution can be balanced on different machines, albeit primitively.
Consider the following code:
$servers = "server1","server2","server3" $data = "param1", "param2", "param3", "param4", "param5", "param6"
The expected result to be achieved is an attempt to load the balance of the script on the machines based on whether there is an active powershell process if it does not move to the next computer and does not perform the same test and subsequent possible execution. The script should go through all the values specified in the $ data array (or something else).
source share