File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,18 +175,32 @@ Invoke-BoltCommand -Command 'pwd' -Targets '@targets.txt'
175175
176176> ** Note:** In PowerShell, always wrap the file name in single quotes.
177177
178+ The file can also contain a JSON array of target names or a Bolt result
179+ object with an ` items ` array where each item has a ` target ` key.
180+
178181### Read targets from stdin
179182
180183To read a list of targets from stdin, pipe the results from another command to
181- Bolt and pass a single dash (` - ` ) to the ` targets ` option.
184+ Bolt and pass a single dash (` - ` ) to the ` targets ` option. Stdin accepts
185+ plain text target lists as well as JSON input. JSON input can be a JSON array
186+ of target names or a Bolt result object with an ` items ` array where each item
187+ has a ` target ` key.
182188
183189_ \* nix shell command:_
184190
185191``` console
186192cat targets.txt | bolt command run 'pwd' --targets -
187193```
188194
189- Reading from stdin is not supported by the PowerShell module.
195+ Pipe JSON output from a Bolt plan to run a command on the resulting targets:
196+
197+ _ \* nix shell command:_
198+
199+ ``` console
200+ bolt plan run myplan --format=json | bolt command run 'pwd' -t-
201+ ```
202+
203+ > ** Note:** Reading from stdin is not supported by the PowerShell module.
190204
191205### Specify targets from the previous command
192206
You can’t perform that action at this time.
0 commit comments