Operators

Comparison Operators

-lt

Less than

-clt

Casesensitive less than (For string comparisons)

-le

Less than or equal to

-cle

Casesensitive less than or equal to (For string comparisons)

-gt

Greater than

-ge

Greater than or equal to

-eq

Equal to

-ceq

Case-sensitive equal to (For string comparisons)

-ne

Not equal to

-cne

Casesensitive not equal to (For string comparisons)

-like

Like (uses wildcard for pattern matching)

-match

A match using Regular Expressions

-contains

Returns true if it contains the object

-NotContains

Inverse of -contains

-in

Returns True if object is in specified collection

-notin

Inverse of -in

Logical Operators

-not

Reverses True and False (the ! symbol is an alias for this operator).

-and

Both subexpressions must be True for the entire expression to be True.

-or

Either subexpression can be True for the entire expression to be True.

Function Operators

-join

Joins the elements of an array into a delimited string.

-split

Splits a delimited string into an array.

-replace

Replaces occurrences of one string with another.

-is

Returns True if an item is of the specified type ($one -is [int]).

-as

Casts the item as the specified type ($one -as [int]).

..

Is a range operator; 1..10 returns 10 objects, 1 through 10.

-f

Is the format operator, replacing placeholders with values: "{0}, {1}" -f "Hello","World".

Last updated

Was this helpful?