Bird
0
0

Which operator in PowerShell uses simple wildcard patterns for string comparison?

easy📝 Conceptual Q11 of 15
PowerShell - Operators
Which operator in PowerShell uses simple wildcard patterns for string comparison?
A-contains
B-like
C-match
D-eq
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of -like

    The -like operator uses simple wildcard characters like * and ? to match patterns in strings.
  2. Step 2: Compare with -match

    The -match operator uses regular expressions, which are more complex than simple wildcards.
  3. Final Answer:

    -like -> Option B
  4. Quick Check:

    Simple wildcard matching = -like [OK]
Quick Trick: Remember: -like = wildcards, -match = regex [OK]
Common Mistakes:
  • Confusing -like with -match
  • Thinking -contains works like -like
  • Assuming -eq supports wildcards

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes