New Training: Control of Flow with PowerShell 7
In this 6-video skill, CBT Nuggets trainer Garth Schulte covers the If, Else, ElseIf, and Switch statements. Learn how to use the ForEach-Object cmdlet, how to loop through code, and how to use the Pipeline Parallelization feature in PowerShell 7. Watch this new Microsoft Windows Server training.
Watch the full course: Programming Foundations with PowerShell 7
This training includes:
37 minutes of training
You’ll learn these topics in this skill:
Control of Flow Introduction
The If Statement
The Switch Statement
Looping Through Code
The Pipeline vs. Loops
Bringing it all Together!
The Vertical Pipe Symbol on Your Keyboard is Actually Really Important
Although its location changes based on what model of keyboard you have, somewhere on your keyboard you have a key that when pressed makes a backslash (\) or an upright vertical line that looks like a pipe (|). The key is usually next to or just below the backspace key. Not everyone knows what that pipe-looking symbol is or what it’s used for. But it is important!
The Windows program PowerShell lets you run complex operations and commands through a text-based interface. It’s more powerful than the visual interface is, and with just a few typed commands, you can alter your Windows operating system drastically.
That pipe symbol is used in PowerShell for linking together commands to make them more versatile. When you combine commands in PowerShell with a pipe, you’re creating what’s called a pipeline. And when you write with a pipe, you’re not just connecting commands like you would combine sentences with commas or periods. A pipe takes the results of the previous command and inputs it automatically into the command that follows it.
Using a pipe in PowerShell lets you accomplish long strings of complex functions in one single command. Mastering pipelines is a step to automating every mundane and repetitious task you have to accomplish with your computer.
delivered to your inbox.