Understand Variables and Types

Now that you know the core components involved, you can begin to use Windows PowerShell to perform some tasks. The following sections will review the core Windows PowerShell elements that every SharePoint administrator must know. These include declaring and using variables and working with various data types, including the core value types as well as arrays and hash tables.

Declare and Use Variables

In all programming and scripting languages, storage locations are needed to hold data so that it can be accessed at a later time. These locations are referred to as variables.

Windows PowerShell variables are designated with a dollar sign. For example, declaring a variable that stores the results of the Get-SPFarm cmdlet ...

Get Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.