PowerShell: Boolean Operators

By Xah Lee. Date: . Last updated: .

Logical Operators

💡 TIP: Operator names are case-insensitive.

a -and b

True when both sides are true.

a -or b

True when at least one side is true.

a -xor b

“exclusive or”. True when the two sides are different.

-not a

negation.

! a

Same as -not

PowerShell, Boolean Related