Export (0) Print
Expand All
Expand Minimize

Start-Sleep

Updated: December 3, 2014

Applies To: Windows PowerShell 4.0

Start-Sleep

Suspends the activity in a script or session for the specified period of time.

Aliases

The following abbreviations are aliases for this cmdlet:

  • sleep

Syntax

Parameter Set: Seconds
Start-Sleep [-Seconds] <Int32> [ <CommonParameters>]

Parameter Set: Milliseconds
Start-Sleep -Milliseconds <Int32> [ <CommonParameters>]




Detailed Description

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>

Specifies how long the resource sleeps in milliseconds. The parameter can be abbreviated as "-m".


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Seconds<Int32>

Specifies how long the resource sleeps in seconds. You can omit the parameter name ("Seconds"), or you can abbreviate it as "-s".


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Int32

    You can pipe the number of seconds to Start-Sleep.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not return any output.


Notes

  • You can also refer to Start-Sleep by its built-in alias, "sleep". For more information, see about_Aliases.

Examples

-------------------------- EXAMPLE 1 --------------------------

This command makes all commands in the session sleep for 15 seconds.


PS C:\> Start-Sleep -s 15

-------------------------- EXAMPLE 2 --------------------------

This command makes all the commands in the session sleep for one-half of a second (500 milliseconds).


PS C:\> Start-Sleep -m 500



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft