O'Reilly logo

Learn PowerShell Toolmaking in a Month of Lunches by Don Jones and Jeffrey Hicks

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

26.2. Creating the proxy function template

The first step in creating a proxy function is to create the template. PowerShell does this for you, so it’s a pretty easy step. The result is a function that looks and works exactly like the original one—essentially a copy of it. You’ll use this template as a starting point for renaming the function, adding parameters, or removing parameters.

We’re going to start with the ConvertTo-HTML cmdlet. Our goal is to create a proxy function named Export-HTML, which adds a –FilePath parameter so that the converted HTML can be written directly to a file. We’re also going to remove the entire parameter set that includes the –Fragment parameter, because it doesn’t make sense (for our use case, at least) to write ...

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