Chapter 4. Operators and expressions

4.1

Arithmetic operators

89

4.2

The assignment operators

96

4.3

Comparison operators

101

4.4

The pattern matching operators

107

4.5

Logical and bitwise operators

113

4.6

Summary

113

 

Operators, Mr. Rico! Millions of them!

 
 --Robert A. Heinlein, Starship Troopers, paraphrased

This chapter covers two of the basic elements of the PowerShell language: operators and expressions. PowerShell has operators. Lots of operators—the full complement you would expect in a conventional programming language and several more. In addition, PowerShell operators are typically more powerful than the corresponding operators in conventional languages such as C or C++. So, if you invest the time to learn what the PowerShell operators are and how they ...

Get Windows PowerShell in Action 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.