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 ...

Get Learn Windows PowerShell in a Month of Lunches now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.