Function definition
📖 Scenario: You are automating a simple task to greet users by name. Instead of writing the greeting multiple times, you want to create a reusable function that prints a greeting message.
🎯 Goal: Create a PowerShell function called Say-Hello that takes a single parameter Name and prints Hello, Name! when called.
📋 What You'll Learn
Create a function named
Say-HelloThe function must accept one parameter called
NameThe function should print the greeting message
Hello, Name! using the parameterCall the function with the argument
World to display Hello, World!💡 Why This Matters
🌍 Real World
Functions help automate repetitive tasks by packaging code into reusable blocks. This saves time and reduces errors.
💼 Career
Knowing how to write and use functions is essential for scripting jobs, system administration, and automation roles.
Progress0 / 4 steps