1/7
Pipelines, loops, error handling, control flow, conditional logic
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is a pipeline?
A pipeline is a method for chaining together commands in a singl, allowing the output of one command to be used as the input for the next.
How do you add a pipeline?
You add one using |
Example: command1 | command2 | command 3
Use a pipeline to get the notepad service then stop it.
Get-Process notepad | Stop-Process
Not all commands can be piped. How can you check whether a command can be piped?
Use the get-help command. Under “-InputObject” it will say whether the command accepts pipeline inputs.

You want to find out if the get-process command accepts pipeline inputs. What command would you type?
get-help -name get-process -full
How many commands can you chain together via the pipeline?
as many as you want
In VS Code, if you only want to run a specific portion of your script, how do you do it?
Highlight the lines you want to run and click Run