Giorgio Bellisario
Giorgio Bellisario

Reputation: 191

Powershell command to wait some time

How can I stop a powershell script execution for an x time and that continue after it?
So, for example, I can run a command and wait 3 seconds to display the user a log, then continue with other script execution.

Upvotes: 7

Views: 17584

Answers (1)

Jeff Zeitlin
Jeff Zeitlin

Reputation: 10799

Microsoft provides the Start-Sleep cmdlet specifically for this purpose. By default, its parameter is the number of seconds to sleep; if you need finer control over the idle period, you can specify -Milliseconds as the unit of time to use.

Upvotes: 9

Related Questions