Skip to content

Add-PodeHandler

SYNOPSIS

Adds a Handler of a specific Type.

SYNTAX

Script (Default)

Add-PodeHandler -Type <String> -Name <String> -ScriptBlock <ScriptBlock> [-ArgumentList <Object[]>]
 [<CommonParameters>]

File

Add-PodeHandler -Type <String> -Name <String> -FilePath <String> [-ArgumentList <Object[]>]
 [<CommonParameters>]

DESCRIPTION

Adds a Handler of a specific Type.

EXAMPLES

EXAMPLE 1

Add-PodeHandler -Type Smtp -Name 'Main' -ScriptBlock { /* logic */ }

EXAMPLE 2

Add-PodeHandler -Type Service -Name 'Looper' -ScriptBlock { /* logic */ }

EXAMPLE 3

Add-PodeHandler -Type Smtp -Name 'Main' -ScriptBlock { /* logic */ } -ArgumentList 'arg1', 'arg2'

PARAMETERS

-ArgumentList

An array of arguments to supply to the Handler's ScriptBlock.

Type: Object[]
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 Handler's main 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 Handler.

Type: String
Parameter Sets: (All)
Aliases:

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

-ScriptBlock

The ScriptBlock for the Handler's main logic.

Type: ScriptBlock
Parameter Sets: Script
Aliases:

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

-Type

The Type of the Handler.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
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

OUTPUTS

NOTES

Back to top