Hi, Damian Garbus here and this is next Poshland blog post. Did you read my post about Powershell comparison operators? I have used there an example with Powershell wildcard symbol. In this post, I want to explain what are wildcard and how you can use it
What is it the Powershell wildcard?
The wildcard lets you compare twice object even you don’t know a part or entire of values. You must know about it if you want to write Powershell scripts. I like showing on my blog real-life examples. Readers write to me that my examples help to understand better Powershell. I believe that it will help you too.
I love pizza! And you? Let’s imagine the pizza menu. 🙂
The * wildcard will match zero or more characters.
When you read the menu in the pizza shop, you would like to find your favorite taste. Sometimes you will find more than pizza, eg.: spaghetti.
To search only pizza on the menu, you can replace all other characters than “pizza” by ” * “.
The ? wildcard will match a single character.
Sometimes you may want to find very similar values in the menu but differ only single characters. In this scenario, you can use ” ? “.
In the end, I have one question for you. What kind of task did you automated recently using Powershell? Please write below in comment space.