Start-Sleep

 

Additional Resources for Start-Sleep

 

Pausing a Windows PowerShell Script

http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/start-sleep.mspx

 

 

SYNOPSIS

Suspend shell, script, or runspace activity for the specified period of time.

 

SYNTAX

Start-Sleep [-seconds] <int> [<CommonParameters>]

 

Start-Sleep -milliseconds <int> [<CommonParameters>]

 

DETAILED DESCRIPTION

The Start-Sleep cmdlet suspends shell, script, or runspace activity for the specified period of time. You can use it in a script to wait for an operation to complete, or in a loop, to wait a specific time before repeating an operation.

 

PARAMETERS

 

-seconds <int>

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

 

Required?

true

Position?

1

Default value

 

Accept pipeline input?  

true (ByValue, ByPropertyName)

Accept wildcard characters? 

false

 

-milliseconds <int>

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

 

Required?

true

Position?

named

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

INPUT TYPE

Int32

 

RETURN TYPE

None

 

NOTES

 

For more information, type "Get-Help Start-Sleep -detailed". For technical information, type "Get-Help Start-Sleep -full".

 

When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

 

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

 

EXAMPLE 1

 

Start-Sleep -s 15

 

This command makes the shell sleep for 15 seconds.

 

EXAMPLE 2

 

Start-Sleep -m 500

 

This command makes the command shell sleep for 1/2 second (500 milliseconds).