O'Reilly logo

Mastering Windows PowerShell Scripting by Brenton J.W. Blawat

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required