You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
This cmdlet defines an HTTP route that your server will listen for.
PARAMETERS
Path: The HTTP Route/Path/endpoint that you call to trigger this script
Method: The HTTP Verb/Method for this request
ScriptBlock: A script block that will be triggered when this HTTP Route/Path/endpoint has been called
ScriptPath: A path to a script that will be triggered when this HTTP Route/Path/endpoint has been called
CommonParameters
EXAMPLE
# Using a script blockNew-WebRoute-Path "/helloworld"-Method "GET"-ScriptBlock {
$response.Send('Hello World');
}
# Using a script pathNew-WebRoute-Path "/helloworld"-Method "GET"-ScriptPath ./example.ps1