-
-
Notifications
You must be signed in to change notification settings - Fork 7
Invoke Script
apobekiaris edited this page Jun 15, 2020
·
4 revisions
Invokes a Powershell script with retry options.
Invoke-Script [-Script] <ScriptBlock> [[-Maximum] <Int32>] [-RetryInterval <Int32>]
[-retryTriggerErrorPattern <String>] [<CommonParameters>]
Invokes a Powershell script with retry options.
PS C:\> invoke-script {throw "test"} -Maximum 2
WARNING: test
Invoke-Script: Error: Retrying in 1 seconds, attempt1 out of 2
----------
Exception:
----------
test
Exception: test
-----------
StackTrace:
-----------
at <ScriptBlock>, <No file>: line 1
at Invoke-Script<Process>, C:\Work\eXpandFramework\XpandPwsh\XpandPwsh\public\System\Invoke-Script.ps1: line 22
at <ScriptBlock>, <No file>: line 1
Exception: test
Invokes the script two times.
{{ Fill Maximum Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill RetryInterval Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Script Description }}
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill retryTriggerErrorPattern Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.