Add PodePage - mdaneri/Pode GitHub Wiki
Helper function to generate simple GET routes.
Add-PodePage -Name <String> -ScriptBlock <ScriptBlock> [-Data <Hashtable>] [-Path <String>]
[-Middleware <Object[]>] [-Authentication <String>] [-Access <String>] [-Role <String[]>] [-Group <String[]>]
[-Scope <String[]>] [-User <String[]>] [-AllowAnon] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Add-PodePage -Name <String> -FilePath <String> [-Data <Hashtable>] [-Path <String>] [-Middleware <Object[]>]
[-Authentication <String>] [-Access <String>] [-Role <String[]>] [-Group <String[]>] [-Scope <String[]>]
[-User <String[]>] [-AllowAnon] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Add-PodePage -Name <String> -View <String> [-Data <Hashtable>] [-Path <String>] [-Middleware <Object[]>]
[-Authentication <String>] [-Access <String>] [-Role <String[]>] [-Group <String[]>] [-Scope <String[]>]
[-User <String[]>] [-AllowAnon] [-FlashMessages] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Helper function to generate simple GET routes from ScritpBlocks, Files, and Views. The output is always rendered as HTML.
Add-PodePage -Name Services -ScriptBlock { Get-Service }
Add-PodePage -Name Index -View 'index'
Add-PodePage -Name About -FilePath '.\views\about.pode' -Data @{ Date = [DateTime]::UtcNow }
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: False
If supplied, the Page 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
The 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: False
A hashtable of Data to supply to a Dynamic File/View, or to be splatted as arguments for the ScriptBlock.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A FilePath, literal or relative, to a valid HTML file.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
If supplied, Views will have any flash messages supplied to them for rendering.
Type: SwitchParameter
Parameter Sets: View
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Like 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: False
A unique name for the page, that will be used in the Path for the route.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An optional Path for the Route, to prepend before the Name.
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: False
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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A ScriptBlock to invoke, where any results will be converted to HTML.
Type: ScriptBlock
Parameter Sets: ScriptBlock
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The name of a View to render, this can be HTML or Dynamic.
Type: String
Parameter Sets: View
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.