Arithmetic operators are used to perform numeric calculations. The operators that are available are available to us in PowerShell are as follows:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Remainder: %
- Shift left: -shl
- Shift right: -shr
As well as its use in numeric calculations, the addition operator may also be used with strings, arrays, and hashtables, and the multiplication operator may also be used with strings and arrays.
The sections below explore each of the operators listed above.