PowerShell: Arithmetic Operators

By Xah Lee. Date: . Last updated: .

Basic Arithmetic Operators

# add
3+4
# 7

# substract
4-3
# 1
# multiply
3*4
# 12
# divide
10/2
# 5

10/2.1
# 4.76190476190476

modulus (remainder of division)

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

Power

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

PowerShell operators

PowerShell, numbers