ConvertTo PodeRoute - mdaneri/Pode GitHub Wiki
Takes an array of Commands, or a Module, and converts them into Routes.
ConvertTo-PodeRoute [[-Commands] <String[]>] [-Module <String>] [-Method <String>] [-Path <String>]
[-Middleware <Object[]>] [-Authentication <String>] [-Access <String>] [-Role <String[]>] [-Group <String[]>]
[-Scope <String[]>] [-User <String[]>] [-AllowAnon] [-NoVerb] [-NoOpenApi]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Takes an array of Commands (Functions/Aliases), or a Module, and generates appropriate Routes for the commands.
ConvertTo-PodeRoute -Commands @('Get-ChildItem', 'Get-Host', 'Invoke-Expression') -Middleware { ... }
ConvertTo-PodeRoute -Commands @('Get-ChildItem', 'Get-Host', 'Invoke-Expression') -Authentication AuthName
ConvertTo-PodeRoute -Module Pester -Path '/api'
ConvertTo-PodeRoute -Commands @('Invoke-Pester') -Module Pester
The name of an Access method which should be used as middleware on this Route.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the Route 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: FalseThe name of an Authentication method which should be used as middleware on this Route.
Type: String
Parameter Sets: (All)
Aliases: Auth
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn array of Commands to convert - if a Module is supplied, these Commands must be present within that Module.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseOne 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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn override HTTP method to use when generating the Routes. If not supplied, Pode will make a best guess based on the Command's Verb.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseLike normal Routes, an array of Middleware that will be applied to all generated Routes.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA Module whose exported commands will be converted.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, no OpenAPI definitions will be generated for the routes created.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the Command's Verb will not be included in the Route's path.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseAn optional Path for the Route, to prepend before the Command Name and Module.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: /
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: FalseOne 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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOne 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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOne 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: Named
Default value: None
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.