Add-PodeTask
SYNOPSIS
Adds a new Task.
SYNTAX
Script (Default)
Add-PodeTask -Name <String> -ScriptBlock <ScriptBlock> [-ArgumentList <Hashtable>] [-Timeout <Int32>]
[-TimeoutFrom <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
File
Add-PodeTask -Name <String> -FilePath <String> [-ArgumentList <Hashtable>] [-Timeout <Int32>]
[-TimeoutFrom <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Adds a new Task, which can be asynchronously or synchronously invoked.
EXAMPLES
EXAMPLE 1
Add-PodeTask -Name 'Example1' -ScriptBlock { Invoke-SomeLogic }
EXAMPLE 2
Add-PodeTask -Name 'Example1' -ScriptBlock { return Get-SomeObject }
PARAMETERS
-ArgumentList
A hashtable of arguments to supply to the Task's ScriptBlock.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FilePath
A literal, or relative, path to a file containing a ScriptBlock for the Task's logic.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
The Name of the Task.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptBlock
The script for the Task.
Type: ScriptBlock
Parameter Sets: Script
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
A Timeout, in seconds, to abort running the Task process. (Default: -1 [never timeout])
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: -1
Accept pipeline input: False
Accept wildcard characters: False
-TimeoutFrom
Where to start the Timeout from, either 'Create', 'Start'. (Default: 'Create')
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Create
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.