This one is a golden oldie and used for migrating data using robocopy. Let’s start with a simple example.
1 |
@('notepad','notepad') | % {while ((gps $_ -ea 0).count -ge 1){sleep 5};start $_} |
First we begin with an array ”@(notepad…)’ where we define the processes to start. Then we use foreach ‘%’ which fetches each item in the array as a pipeline item ‘$_’ and then checks how many …