From the course: Learning PowerShell for Windows Server Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

How the pipeline works

How the pipeline works

From the course: Learning PowerShell for Windows Server Administration

Start my 1-month free trial

How the pipeline works

- [Instructor] The Pipeline in PowerShell is both a highly advanced scripting strategy and a fundamental concept of how PowerShell works. Let's start with the foundation and build from there. Every commandlet that you use in PowerShell sends objects through a pipeline. If I run the Get-Module commandlet, PowerShell will gather up all the PowerShell modules and run them through a pipe. If I add nothing to that commandlet, the objects will be processed by the Out-Default commandlet. Which is currently configured to display the four properties of currently loaded modules, and that's it, that's the end of the pipe. And that's the basic idea. We send in objects at the beginning and we receive a default output at the end. When we look at it in terms of a single commandlet, it doesn't seem to do much. So, let's take a look at what happens when we add another segment to the pipe. There is a commandlet in PowerShell designed to be a filter of objects. Where-Object is designed to remove objects…

Contents