Skip to content

Stream handling, param block, PowerShellManager #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions examples/PSCoreApp/MyHttpTrigger/run.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
param($req, $TriggerMetadata)

# Write-Host $TriggerMetadata["Name"]

# Invoked with Invoke-RestMethod:
# irm http://localhost:7071/api/MyHttpTrigger?Name=Tyler
# Input bindings are added to the scope of the script: ex. `$req`

# If no name was passed by query parameter
$name = 'World'

# You can interact with query parameters, the body of the request, etc.
if($req.Query.Name) {
$name = $req.Query.Name
}

Write-Verbose "Hello $name" -Verbose
Write-Warning "Warning $name"
# you can write to the same streams as you would in a normal PowerShell script
Write-Verbose "Verbose $name" -Verbose
Write-Warning "Warning $i"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is $i coming from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'oh!


# You set the value of your output bindings by assignment `$nameOfOutputBinding = 'foo'`
$res = [HttpResponseContext]@{
Body = @{ Hello = $name }
ContentType = 'application/json'
Expand Down

This file was deleted.

This file was deleted.

Loading