-
Notifications
You must be signed in to change notification settings - Fork 0
Add PodeMiddleware
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Middleware schema: 2.0.0
Adds a new Middleware to be invoked before every Route, or certain Routes.
Add-PodeMiddleware -Name <String> -ScriptBlock <ScriptBlock> [-Route <String>] [-ArgumentList <Object[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Add-PodeMiddleware -Name <String> [-InputObject] <Hashtable> [-Route <String>] [-ArgumentList <Object[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Adds a new Middleware to be invoked before every Route, or certain Routes. ScriptBlock should return $true to continue execution, or $false to stop.
Add-PodeMiddleware -Name 'BlockAgents' -ScriptBlock { /* logic */ }
Add-PodeMiddleware -Name 'CheckEmailOnApi' -Route '/api/*' -ScriptBlock { /* logic */ }
An array of arguments to supply to the Middleware's ScriptBlock.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A Middleware HashTable from New-PodeMiddleware, or from certain other functions that return Middleware as a HashTable.
Type: Hashtable
Parameter Sets: Input
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The Name of the Middleware.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
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: False
A Route path for which Routes this Middleware should only be invoked against.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The Script defining the logic of the Middleware. Should return $true to continue execution, or $false to stop.
Type: ScriptBlock
Parameter Sets: Script
Aliases:
Required: True
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.
sss
x