Start-PodeServer
SYNOPSIS
Starts a Pode Server with the supplied ScriptBlock.
SYNTAX
Script (Default)
Start-PodeServer [-ScriptBlock] <ScriptBlock> [-Interval <Int32>] [-Name <String>] [-Threads <Int32>]
[-RootPath <String>] [-Request <Object>] [-ServerlessType <String>] [-StatusPageExceptions <String>]
[-ListenerType <String>] [-EnablePool <String[]>] [-DisableTermination] [-Quiet] [-Browse]
[-EnableBreakpoints] [-ProgressAction <ActionPreference>] [<CommonParameters>]
File
Start-PodeServer -FilePath <String> [-Interval <Int32>] [-Name <String>] [-Threads <Int32>]
[-RootPath <String>] [-Request <Object>] [-ServerlessType <String>] [-StatusPageExceptions <String>]
[-ListenerType <String>] [-EnablePool <String[]>] [-DisableTermination] [-Quiet] [-Browse] [-CurrentPath]
[-EnableBreakpoints] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Starts a Pode Server with the supplied ScriptBlock.
EXAMPLES
EXAMPLE 1
Start-PodeServer { /* logic */ }
EXAMPLE 2
Start-PodeServer -Interval 10 { /* logic */ }
EXAMPLE 3
Start-PodeServer -Request $LambdaInput -ServerlessType AwsLambda { /* logic */ }
PARAMETERS
-Browse
Open the web Server's default endpoint in your default browser.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-CurrentPath
Sets the Server's root path to be the current working path - for -FilePath only.
Type: SwitchParameter
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DisableTermination
Disables the ability to terminate the Server.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-EnableBreakpoints
If supplied, any breakpoints created by using Wait-PodeDebugger will be enabled - or disabled if false passed explicitly, or not supplied.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-EnablePool
Tells Pode to configure certain RunspacePools when they're being used adhoc, such as Timers or Schedules.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FilePath
A literal, or relative, path to a file containing a ScriptBlock for the Server's logic. The directory of this file will be used as the Server's root path - unless a specific -RootPath is supplied.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Interval
For 'Service' type Servers, will invoke the ScriptBlock every X seconds.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-ListenerType
An optional value to use a custom Socket Listener. The default is Pode's inbuilt listener. There's the Pode.Kestrel module, so the value here should be "Kestrel" if using that.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False
-Name
An optional name for the Server (intended for future ideas).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
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
-Quiet
Disables any output from the Server.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Request
Intended for Serverless environments, this is Requests details that Pode can parse and use.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RootPath
An override for the Server's root path.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptBlock
The main logic for the Server.
Type: ScriptBlock
Parameter Sets: Script
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-ServerlessType
Optional, this is the serverless type, to define how Pode should run and deal with incoming Requests.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False
-StatusPageExceptions
An optional value of Show/Hide to control where Stacktraces are shown in the Status Pages. If supplied this value will override the ShowExceptions setting in the server.psd1 file.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False
-Threads
The numbers of threads to use for Web, SMTP, and TCP servers.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 1
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.