Question about workflow

Hello all,
I have a script that I run from my laptop, against remote servers. The script prompts me for a ComputerName, then eventually installs an agent on the remote computer. It checks if the agent exists first, if it does not, it copies it, then it checks if the service is running and installs the agent if the service is not running. It works really well. I sometimes need to execute this script against like 5 or 6 servers at the same time.

I was thinking of re-writing it using a Foreach -Parallel workflow to have them done all at the same time.

My problem is, my script uses Invoke-Command to execute Start-Process on the remote machines…how can I do something similiar in a workflow without using Invoke-Command?

Thanks for any tips.


Why don’t you like to use Invoke-Command? Please (re-)read the help for

You can provide an array of computer names for the parameter -ComputerName. This way your commands will run at the same time for all computers you provided?! :man_shrugging:t4: