O'Reilly logo

Learn Windows PowerShell in a Month of Lunches by Don Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21. Creating your own “cmdlets” and modules

At the end of chapter 19, you saw how to make a function (in listing 19.5) that output custom objects to the pipeline. Mastering that kind of output is a key to becoming a PowerShell guru, but there’s also the question of input.

In chapter 19, we passed input to the function by means of a parameter. In this chapter, we’re going to look at some other means of getting input into the function. By combining different input techniques with what you already know about producing output, you’ll find that you can create a tool that behaves almost exactly like a PowerShell cmdlet!

21.1. Turning a reusable tool into a full-fledged cmdlet

As I said, the function in listing 19.5 accepted input primarily ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required