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

: http://halr9000.com/article/615

Post a comment now » Sorry, the comments are closed.

No comments yet.

Sorry, the comment form is closed at this time.

  • Microblog

  • Recent Posts

  • Recent Comments

  • meta