Powershell: How to loop through a text file (running a command) in batches of 500 : I have a very large exported list in text and i need to go through each of the entries and run a command using the entry. But i wish to do this in batches of 500 - as i need to allow processing time.

What I do not understand is how i Loop through the text file but only run a limited number at a time, then wait for a certain time, before running the next block until they are all completed.

Can someone help with an example which i can then apply to my scenario?

Many thanks!