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 19. From command to script to function

Let’s say that you’ve come up with a great command that you not only want to use again and again, but you want to share with your colleagues and co-workers. It’s a somewhat complicated command, so you want to put it into a batch file for them. There are also one or two things that need to change each time you run the command, such as a computer name or other parameter, so you want to make it easy for them to provide that information. PowerShell makes it easy to do all of that, and you’re going to see how in this chapter.

19.1. Turning a command into a reusable tool

If I’ve said it once, I’ve said it a million times: you don’t need to be a programmer to do amazing things with PowerShell. Given ...

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