Variable creation with $ in PowerShell
📖 Scenario: You are writing a simple PowerShell script to store and display information about a fruit.
🎯 Goal: Learn how to create and use variables in PowerShell using the $ symbol.
📋 What You'll Learn
Create a variable with the exact name
$fruitAssign the exact value
Apple to $fruitCreate a variable with the exact name
$quantityAssign the exact value
10 to $quantityUse a variable
$message to combine $fruit and $quantity in a stringPrint the
$message variable💡 Why This Matters
🌍 Real World
Variables are used in scripts to store data like names, counts, or settings. This helps automate tasks by reusing values easily.
💼 Career
Knowing how to create and use variables is essential for writing PowerShell scripts in IT jobs, system administration, and automation.
Progress0 / 4 steps