Challenge

Completed

Code challenges throughout these modules reinforce what you've learned and help you gain confidence before you move on to the next lesson.

Step 1: Close any open files in the Cloud Shell code editor

Use the keyboard shortcut Ctrl+Q in Windows (or +Q on macOS) to close any open files in the Azure Cloud Shell code editor.

Step 2: Create a new file to write your code

Create a new file named GettingStarted.ps1, and use the Cloud Shell code editor to open it.

Step 3: Write code in the Cloud Shell code editor to display two messages

Use the techniques you've already learned to print one message and then collect user input to reuse in a second message. Earlier, you displayed a message in just one line of code. You then requested input from a user and then reused that value to print a custom message. Use both techniques for this challenge.

No matter how you do it, your code should produce something like the following output. In this example, replace the placeholder text <current date> and <your name> with values that you choose.

Today's date is <current date>.
Today is the day <your name> began a PowerShell programming journey.

Step 4: Run the code

Close the code editor, and then run the script in the Cloud Shell terminal.

Whether you get stuck and need to peek at the solution or you finish successfully, continue to view a solution to this challenge.