Add PodeTimer - mdaneri/Pode GitHub Wiki
Adds a new Timer with logic to periodically invoke.
Add-PodeTimer -Name <String> -Interval <Int32> -ScriptBlock <ScriptBlock> [-Limit <Int32>] [-Skip <Int32>]
[-ArgumentList <Object[]>] [-OnStart] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Add-PodeTimer -Name <String> -Interval <Int32> [-Limit <Int32>] [-Skip <Int32>] -FilePath <String>
[-ArgumentList <Object[]>] [-OnStart] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Adds a new Timer with logic to periodically invoke, with options to only run a specific number of times.
Add-PodeTimer -Name 'Hello' -Interval 10 -ScriptBlock { 'Hello, world!' | Out-Default }
Add-PodeTimer -Name 'RunOnce' -Interval 1 -Limit 1 -ScriptBlock { /* logic */ }
Add-PodeTimer -Name 'RunAfter60secs' -Interval 10 -Skip 6 -ScriptBlock { /* logic */ }
Add-PodeTimer -Name 'Args' -Interval 2 -ScriptBlock { /* logic */ } -ArgumentList 'arg1', 'arg2'
An array of arguments to supply to the Timer's ScriptBlock.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA literal, or relative, path to a file containing a ScriptBlock for the Timer's logic.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe number of seconds to periodically invoke the Timer's ScriptBlock.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseThe number of times the Timer should be invoked before being removed. (If 0, it will run indefinitely)
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseThe Name of the Timer.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the timer will trigger when the server starts.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe script for the Timer.
Type: ScriptBlock
Parameter Sets: Script
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe number of "invokes" to skip before the Timer actually runs.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.