Start-Sleep
Start-Sleep -Milliseconds* <Int32> [<CommonParameters>]
Start-Sleep [-Seconds*] <Int32> [<CommonParameters>]
The Start-Sleep cmdlet suspends the activity in a script or session for the specified period of time. You can use it for many tasks, such as waiting for an operation to complete or pausing before repeating an operation.
Parameters
-Milliseconds <Int32>
- This value is required
- Default value is None
- Accepts pipeline input ByPropertyName
Specifies how long the resource sleeps in milliseconds. The parameter can be abbreviated as m .
-Seconds <Int32>
- This value is required
- Default value is None
- Accepts pipeline input ByPropertyName
Specifies how long the resource sleeps in seconds. You can omit the parameter name ( Seconds ), or you can abbreviate it as s .
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.
Inputs
System.Int32Outputs
NoneExamples
-
Sleep all commands for 15 seconds:
PS C:\> Start-Sleep -s 15
This command makes all commands in the session sleep for 15 seconds.
-
Sleep all commands:
PS C:\> Start-Sleep -m 500
This command makes all the commands in the session sleep for one-half of a second (500 milliseconds).
Additional Notes
You can also refer to Start-Sleep by its built-in alias, sleep *. For more information, see about_Aliases. *
This work is licensed under a Creative Commons Attribution 4.0 International. It is attributed to Microsoft Corporation and can be found here.
PowerShell Commands