Skip to main content
Version: v0.16.0

PowerShell Connector Examples

Setup​

  1. Download and set up Sequence. See the quick start for more info.
  2. Add the PowerShell connector. See connectors for more info on managing connectors.
./sequence.exe connector add Sequence.Connectors.Pwsh

Examples​

Run a powershell script with no input or output stream:

- PwshRun Script: 'Write-Information $Message' WithVariables: (Message: 'Hello there!')

Run an inline script that returns two PSObjects and prints them:

- ForEach
Array: (
PwshRunScriptAsync Script: "@( [pscustomobject]@{ key1 = 'one'; key2 = 2 }, [pscustomobject]@{ key1 = 'three'; key2 = 4 }) | Write-Output"
)
Action: (Print <>)

Run a script that receives input as an Entity stream:

- <Input> = [
(prop1: "value1" prop2: 2),
(prop1: "value3" prop2: 4)
]
- ForEach
Array: (
PwshRunScriptAsync
Script: "$input | ForEach-Object { Write-Output $_ }"
Input: <Input>
)
Action: (Print <>)