Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

New PostRoute

Tyler James Leonhardt edited this page Nov 11, 2017 · 2 revisions

NAME

New-PostRoute

SYNOPSIS

Adds a new Route with HTTP Method "POST"

SYNTAX

New-PostRoute [[-Path] <Object>] [[-ScriptBlock] <Object>] [[-ScriptPath] <Object>] [<CommonParameters>]

DESCRIPTION

A shorthand version of doing New-WebRoute -Method "POST"

PARAMETERS

  • Path: The HTTP Route/Path/endpoint that you call to trigger this script
  • 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 block
New-PostRoute -Path "/helloworld" -ScriptBlock {
   $response.Send('Hello World');
}

# Using a script path
New-PostRoute -Path "/helloworld" -ScriptPath ./example.ps1
Clone this wiki locally