Chapter 6. Operators

This chapter covers

  • Logical and comparison operators
  • Bitwise operators
  • Arithmetic operators
  • Type operators
  • Other special operators

In any computer language, operators provide a means of comparing and manipulating pieces of data. PowerShell’s no exception, offering a wide variety of operators for different tasks.

All of these operators have a common syntactical form. Practically all Power-Shell operators start with a dash or a hyphen, followed by the operator name. You’ll see plenty of examples of this in the following sections and throughout the rest of the book. If you have prior experience with other scripting or programming languages, PowerShell’s operators can seem confusing or odd at first, but you’ll get used ...

Get PowerShell in Depth now with O’Reilly online learning.

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