This script is a generic wrapper for the While statement that will execute a condition a given number of max tries, waiting a given number of seconds in between.
This example will execute the “IsItDoneYet” function (that checks a hypothetical external factor) once every 5 seconds, a total of no more than 24 times, which will take approximately two minutes, not including function execution time.
PS > $condition = { IsItDoneYet }
PS > WhileTimeout 5 24 $condition
download | new post

No comments yet.