Add-KrHtmlTemplateRoute
SYNOPSIS
Adds a new HTML template route to the Kestrun server.
SYNTAX
__AllParameterSets
Add-KrHtmlTemplateRoute [[-Server] <KestrunHost>] [-Pattern] <string> [-HtmlTemplatePath] <string>
[[-AuthorizationScheme] <string[]>] [[-AuthorizationPolicy] <string[]>] [-PassThru]
[<CommonParameters>]
ALIASES
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION
This function allows you to add a new HTML template route to the Kestrun server by specifying the route path and the HTML template file path.
EXAMPLES
EXAMPLE 1
Add-KrHtmlTemplateRoute -Server $myServer -Path “/myroute” -HtmlTemplatePath “C:\Templates\mytemplate.html” Adds a new HTML template route to the specified Kestrun server with the given path and template file.
EXAMPLE 2
Get-KrServer | Add-KrHtmlTemplateRoute -Path “/myroute” -HtmlTemplatePath “C:\Templates\mytemplate.html” -PassThru Adds a new HTML template route to the current Kestrun server and returns the route object
PARAMETERS
-AuthorizationPolicy
An optional array of authorization policies for the route.
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-AuthorizationScheme
An optional array of authorization schemes for the route.
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-HtmlTemplatePath
The file path to the HTML template to be used for the route.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-PassThru
If specified, the function will return the created route object.
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Pattern
The URL path for the new route.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Path
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Server
The Kestrun server instance to which the route will be added. If not specified, the function will attempt to resolve the current server context.
Type: Kestrun.Hosting.KestrunHost
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Kestrun.Hosting.KestrunHost
{{ Fill in the Description }}
OUTPUTS
[Microsoft.AspNetCore.Builder.IEndpointConventionBuilder] representing the created route.
{{ Fill in the Description }}
Kestrun.Hosting.KestrunHost
{{ Fill in the Description }}
NOTES
This function is part of the Kestrun PowerShell module and is used to manage routes
RELATED LINKS
{{ Fill in the related links here }}