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

New PutRoute

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

NAME

New-PutRoute

SYNOPSIS

Adds a new Route with HTTP Method "PUT"

SYNTAX

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

DESCRIPTION

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

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-PutRoute -Path "/helloworld" -ScriptBlock {
   $response.Send('Hello World');
}

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