Bird
0
0

What does the PowerShell range operator 1..5 produce?

easy📝 Conceptual Q11 of 15
PowerShell - Operators
What does the PowerShell range operator 1..5 produce?
AAn empty list
BA list of numbers from 5 to 1 inclusive
CA syntax error
DA list of numbers from 1 to 5 inclusive
Step-by-Step Solution
Solution:
  1. Step 1: Understand the range operator syntax

    The range operator .. creates a sequence of numbers from the first number to the second number.
  2. Step 2: Apply the operator to 1..5

    It creates a list starting at 1 and ending at 5, including both ends.
  3. Final Answer:

    A list of numbers from 1 to 5 inclusive -> Option D
  4. Quick Check:

    Range 1..5 = 1,2,3,4,5 [OK]
Quick Trick: Range operator lists numbers from start to end inclusive [OK]
Common Mistakes:
  • Thinking it counts down by default
  • Expecting exclusive end value
  • Confusing syntax with other operators

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes