O'Reilly logo

Learn Windows PowerShell 3 in a Month of Lunches, Second Edition by Don Jones and Jeffery 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

Chapter 18. Variables: a place to store your stuff

We’ve already mentioned that PowerShell contains a scripting language, and in a few more chapters we’ll start to play with it. But once you start scripting, you tend to start needing variables, so we’ll get those out of the way in this chapter. You can use variables in a lot of places other than long, complex scripts, so we’ll also use this chapter to show you some practical ways to use them.

18.1. Introduction to variables

A simple way to think of a variable is as a box in the computer’s memory that has a name. You can put whatever you want into the box: a single computer name, a collection of services, an XML document, and so on. You access the box by using its name, and when accessing it, ...

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