Bird
0
0

In PowerShell, which operator is used to check if two values are equal?

easy📝 Conceptual Q11 of 15
PowerShell - Operators
In PowerShell, which operator is used to check if two values are equal?
A-gt
B-ne
C-eq
D-lt
Step-by-Step Solution
Solution:
  1. Step 1: Understand comparison operators

    PowerShell uses specific operators to compare values, such as -eq for equality, -ne for not equal, -gt for greater than, and -lt for less than.
  2. Step 2: Identify the equality operator

    The operator -eq checks if two values are equal, returning True if they are the same.
  3. Final Answer:

    -eq -> Option C
  4. Quick Check:

    Equality operator = -eq [OK]
Quick Trick: Remember: 'eq' means equal in PowerShell [OK]
Common Mistakes:
  • Confusing -eq with -ne (not equal)
  • Using == instead of -eq
  • Mixing up -gt and -lt

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes