If you want to add a sleep (delay) to your PowerShell script, you need to make use of the Start-Sleep cmdlet,
Let's take a look at a few examples.
Example 1: One-Liner Sleep
echo "Sleeping for 10 seconds"; Start-Sleep -Seconds 10; echo "Done!"
Example 2: Sleep with Script
$numbers = 1..10
foreach ($num in $numbers) {
# Sleep for 1 seconds
Start-Sleep -Seconds 1
Write-Host $num
}

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!