To add sleep between statements or commands in Windows Powershell, you can make use of Start-Sleep -s {int}
Example:echo "hello"
Start-Sleep -s 1
ls
echo "Sleeping for 10 seconds..."
Start-Sleep -s 10
pwd
echo "Sleeping for 5 seconds..."
Start-Sleep -s 5
Output:
PS C:\> echo "hello"
hello
PS C:\> Start-Sleep -s 1
PS C:\> ls
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/14/2018 6:56 AM EFI
d----- 5/13/2020 5:58 PM PerfLogs
d-r--- 11/14/2018 4:10 PM Program Files
d----- 1/26/2022 11:16 AM Program Files (x86)
d-r--- 1/23/2022 11:37 PM Users
d----- 1/23/2022 11:37 PM Windows
PS C:\> echo "Sleeping for 10 seconds..."
Sleeping for 10 seconds...
PS C:\> Start-Sleep -s 10
PS C:\> pwd
Path
----
C:\
PS C:\> echo "Sleeping for 5 seconds..."
Sleeping for 5 seconds...
PS C:\> Start-Sleep -s 5
PS C:\>
More Posts related to Powershell,
- [Fix] Powershell - Term winget is not recognized as the name of a cmdlet function or script file
- Download Google Chrome setup exe file using PowerShell
- Run JumpCloud Commands in Powershell
- How to check PowerShell version
- How to upgrade PowerShell on Mac
- How to Open PowerShell on Mac?
- How to add sleep in Powershell Script
- How to switch to Powershell on Mac Terminal
- Update Powershell Using Command Line
- How to install powershell on macOS
- PowerShell ps1 script is not digitally signed, you cannot run this script on the current system
- How to Identify installed PowerShell version
More Posts:
- GitHub: How to Search Code - Git
- Cannot create new Microsoft Team using PowerShell, even as Admin - Teams
- Base64 Encoding Decoding in Python Programming - Python
- How to know docker Engine details - Docker
- How to Share Microsoft SharePoint Site with Users or Groups - SharePoint
- Display (Show) bookmarks bar Safari - HowTos
- How to switch Eclipse IDE Workspace - Eclipse
- Android Emulator cannot be opened because the developer cannot be verified. [M1 Mac] - Android