Chapter 5. Advanced operators and variables

 

This chapter covers:

  • 5.1 Operators for working with types
  • 5.2 The unary operators
  • 5.3 Grouping and subexpressions
  • 5.4 Array operators
  • 5.5 Property and method operators
  • 5.6 The format operator
  • 5.7 Redirection and the redirection operators
  • 5.8 Working with variables
  • 5.9 Summary

The greatest challenge to any thinker is stating the problem in a way that will allow a solution.

Bertrand Russell

The previous chapter covered the basic operators in PowerShell, and in this chapter we’ll continue our discussion of operators by covering the advanced ones, which include things that some people don’t think of as operators at all. We’ll break the operators into related groups, as shown in figure 5.1.

Figure 5.1. The broad groups of operators we’ll cover in this chapter

In this chapter, we’ll look at how to work with types, properties, and methods and how to use these operators to build complex data structures. The chapter concludes with a detailed discussion of how variables work in PowerShell and how you can use them with operators to accomplish significant tasks.

5.1. Operators for Working with Types

5.2. The Unary Operators

5.3. Grouping and Subexpressions

5.4. Array Operators

5.5. Property and Method Operators

5.6. The Format Operator

5.7. Redirection and the Redirection Operators

5.8. Working with Variables

5.9. Summary