Range operator (..)
📖 Scenario: You are helping a small store owner who wants to list product IDs for a sale. The IDs are numbers in a sequence. You will use PowerShell's range operator to create this list easily.
🎯 Goal: Build a PowerShell script that uses the range operator .. to create a list of product IDs from 101 to 110, then display them.
📋 What You'll Learn
Create a variable called
productIDs using the range operator .. to include numbers from 101 to 110Create a variable called
startID and set it to 101Use the range operator with
startID to create productIDsPrint the
productIDs variable to show the list of IDs💡 Why This Matters
🌍 Real World
Range operators help quickly create lists of numbers, useful for IDs, dates, or steps in automation scripts.
💼 Career
Knowing how to generate sequences with range operators is a basic skill for scripting tasks in IT, DevOps, and automation roles.
Progress0 / 4 steps