Sometimes, we need to pause scripting where any asynchronous operation is in progress or we have to wait for some file to appear. In all such cases, Start-Sleep can help you achieve that. Let's take a look into syntax and then we will use the same in our example :
Syntax:
Start-Sleep -Milliseconds <int> [<CommonParameters>]
Start-Sleep [-Seconds] <int> [<CommonParameters>]
Example:
Pause the script for 5 seconds:
Start-Sleep -Seconds 5
Syntax:
Start-Sleep -Milliseconds <int> [<CommonParameters>]
Start-Sleep [-Seconds] <int> [<CommonParameters>]
Example:
Pause the script for 5 seconds:
Start-Sleep -Seconds 5
No comments:
Post a Comment