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

$request.Query

Tyler James Leonhardt edited this page Apr 24, 2018 · 1 revision

Get the query parameters of a request.

Example:

New-WebRoute -Path "/hellome" -Method "GET" -ScriptBlock {
    if ($request.Query['name']) {
        $response.Send('Hello ' + $request.Query['name']);
    } else {
        $response.Send('Hello World');
    }
}
PS > Invoke-RestMethod -Uri http://localhost:8082/hellome?name=PowerShell
Hello PowerShell
Clone this wiki locally