Contains, like, and match operators
The -contains
, -like
, and -match
operators are very similar in function. While they all compare data, they all have their own purpose in your scripts. Each of these operators are case-insensitive. This means that when you are searching for items using these operators, they will match all instances of the value in the expression. In instances where you need the search to be case-specific, you can append c
in front of the operator to force case sensitivity. These would look like –ccontains
, -clike
, and –cmatch
. To force case insensitivity, you can also append i
in front of the operator. These would look like –icontains
, -ilike
, and –imatch
.
Each of these operators also has an inverse operator that is formed by appending the word "not" in front of the operator. Examples of these operators include –notcontains
, -notlike
, and -notmatch
. You may also append case sensitivity and case insensitivity to these operators...