@@ -100,6 +100,17 @@ def orchestrator_function(context: df.DurableOrchestrationContext):
100
100
main = df.Orchestrator.create(orchestrator_function)
101
101
```
102
102
103
+ # [ PowerShell] ( #tab/powershell )
104
+
105
+ ``` powershell
106
+ param($Context)
107
+
108
+ $input = $Context.Input
109
+
110
+ # Do some work
111
+
112
+ $output
113
+ ```
103
114
---
104
115
105
116
Most orchestrator functions call activity functions, so here is a "Hello World" example that demonstrates how to call an activity function:
@@ -145,6 +156,18 @@ def orchestrator_function(context: df.DurableOrchestrationContext):
145
156
main = df.Orchestrator.create(orchestrator_function)
146
157
```
147
158
159
+ # [ PowerShell] ( #tab/powershell )
160
+
161
+ ``` powershell
162
+ param($Context)
163
+
164
+ $name = $Context.Input.Name
165
+
166
+ $output = Invoke-DurableActivity -FunctionName 'SayHello' -Input $name
167
+
168
+ $output
169
+ ```
170
+
148
171
---
149
172
150
173
## Activity trigger
@@ -233,6 +256,12 @@ def main(name: str) -> str:
233
256
return f " Hello { name} ! "
234
257
```
235
258
259
+ # [ PowerShell] ( #tab/powershell )
260
+ ``` powershell
261
+ param($name)
262
+
263
+ "Hello $name!"
264
+ ```
236
265
---
237
266
238
267
### Using input and output bindings
@@ -380,6 +409,34 @@ async def main(msg: func.QueueMessage, starter: str) -> None:
380
409
instance_id = await client.start_new(" HelloWorld" , client_input = payload)
381
410
```
382
411
412
+ # [ PowerShell] ( #tab/powershell )
413
+
414
+ ** function.json**
415
+ ``` json
416
+ {
417
+ "bindings" : [
418
+ {
419
+ "name" : " input" ,
420
+ "type" : " queueTrigger" ,
421
+ "queueName" : " durable-function-trigger" ,
422
+ "direction" : " in"
423
+ },
424
+ {
425
+ "name" : " starter" ,
426
+ "type" : " durableClient" ,
427
+ "direction" : " in"
428
+ }
429
+ ]
430
+ }
431
+ ```
432
+
433
+ ** run.ps1**
434
+ ``` powershell
435
+ param($[string] $input, $TriggerMetadata)
436
+
437
+ $InstanceId = Start-DurableOrchestration -FunctionName $FunctionName -Input $input
438
+ ```
439
+
383
440
---
384
441
385
442
More details on starting instances can be found in [ Instance management] ( durable-functions-instance-management.md ) .
0 commit comments