From the course: PowerShell: Functions for Advanced Automation

Unlock the full course today

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

Complex pipeline output

Complex pipeline output

From the course: PowerShell: Functions for Advanced Automation

Start my 1-month free trial

Complex pipeline output

- [Instructor] The PowerShell Pipeline is most often used to convey objects from one step in a process to another. You may collect objects using a cmdlet like Get-ADUser or Get-Process and then pass them down the pipeline to use properties for sorting or filtering or maybe take advantage of methods to make changes. But sometimes the object that we want to pass down the pipeline is a collection of data rather than a collection of objects. And that requires one more trick. We normally use variables to store data in our scripts. For example, we may have a function like this that collects information about an individual computer. I could use cmdlets like these to pull the IP address, the computer name, and other information about the computer. Notice how some variables now contain strings like the computer name. Others contain a number formatted as a date, and I used a trick that I picked up to take this list of IP addresses and split it up into an array to store in this variable. This…

Contents