Skip to content

Invoke Retry

Apostolis Bekiaris edited this page Aug 20, 2019 · 4 revisions

external help file: XpandPwsh-help.xml Module Name: XpandPwsh schema: 2.0.0

Invoke-Retry

SYNOPSIS

Retry on error.

SYNTAX

Invoke-Retry [-ScriptBlock] <ScriptBlock> [[-Maximum] <Int32>] [-RetryInterval <Int32>] [<CommonParameters>]

DESCRIPTION

Retry on error.

EXAMPLES

Example 1

PS C:\> { Get-WebFile 'http://www.download.com/file.zip' } | Invoke-Retry

PARAMETERS

-Maximum

The maximum attempts, default is five.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RetryInterval

Default is one second.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ScriptBlock

Script to retry.

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally
You can’t perform that action at this time.