Skip to content

Add-PodeRouteGroup

SYNOPSIS

Add a Route Group for multiple Routes.

SYNTAX

Add-PodeRouteGroup [[-Path] <String>] [-Routes] <ScriptBlock> [[-Middleware] <Object[]>]
 [[-EndpointName] <String[]>] [[-ContentType] <String>] [[-TransferEncoding] <String>]
 [[-ErrorContentType] <String>] [[-Authentication] <String>] [[-Access] <String>] [[-IfExists] <String>]
 [[-Role] <String[]>] [[-Group] <String[]>] [[-Scope] <String[]>] [[-User] <String[]>] [-AllowAnon]
 [[-OADefinitionTag] <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Add a Route Group for sharing values between multiple Routes.

EXAMPLES

EXAMPLE 1

Add-PodeRouteGroup -Path '/api' -Routes { Add-PodeRoute -Path '/route1' -Etc }

PARAMETERS

-Access

The name of an Access method which should be used as middleware on this Route.

Type: String
Parameter Sets: (All)
Aliases:

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

-AllowAnon

If supplied, the Routes will allow anonymous access for non-authenticated users.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Authentication

The name of an Authentication method which should be used as middleware on the Routes.

Type: String
Parameter Sets: (All)
Aliases: Auth

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

-ContentType

The content type to use for the Routes, when parsing any payloads.

Type: String
Parameter Sets: (All)
Aliases:

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

-EndpointName

The EndpointName of an Endpoint(s) to use for the Routes.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-ErrorContentType

The content type of any error pages that may get returned.

Type: String
Parameter Sets: (All)
Aliases:

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

-Group

One or more optional Groups that will be authorised to access this Route, when using Authentication with an Access method.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-IfExists

Specifies what action to take when a Route already exists. (Default: Default)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: Default
Accept pipeline input: False
Accept wildcard characters: False

-Middleware

An array of ScriptBlocks for optional Middleware to give each Route.

Type: Object[]
Parameter Sets: (All)
Aliases:

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

-OADefinitionTag

An Array of strings representing the unique tag for the API specification. This tag helps in distinguishing between different versions or types of API specifications within the application. You can use this tag to reference the specific API documentation, schema, or version that your function interacts with.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-Path

The URI path to use as a base for the Routes, that should be prepended.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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

-Role

One or more optional Roles that will be authorised to access this Route, when using Authentication with an Access method.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-Routes

A ScriptBlock for adding Routes.

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

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

-Scope

One or more optional Scopes that will be authorised to access this Route, when using Authentication with an Access method.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-TransferEncoding

The transfer encoding to use for the Routes, when parsing any payloads.

Type: String
Parameter Sets: (All)
Aliases:

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

-User

One or more optional Users that will be authorised to access this Route, when using Authentication with an Access method.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 14
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