PowerShell: Arithmetic Operators

By Xah Lee. Date: . Last updated: .

Basic Arithmetic Operators

# addition
3+4
# 7

# substraction, sign negation
4-3
# 1

# multiplication
3*4
# 12

# division
10/2
# 5

10/2.1
# 4.76190476190476

# modulus (remainder of division)
5%2
# 1

Power

[Math]::Pow(2,3)
# 8

Bit Operators