Menu
CoddyTech

Hello World!

Part of the PowerShell Basics section of Coddy's PowerShell journey. Lesson 2 of 28.

Write-Output sends a value to the output. When the script ends, every value in the output is printed, each on its own line:

Write-Output "Good morning"
Write-Output 42
Good morning
42

Text goes inside quotes. Quotes mark where the text starts and ends, and they are not printed. A number such as 42 needs no quotes.

A value on a line by itself is sent to the output too, so this line prints Good night as well:

"Good night"

Both forms do the same thing. Write-Output makes it clear that the line prints, so this course uses it in the first lessons.

challenge icon

Challenge

Beginner

Write a script that prints two lines.

  1. Print Hello World!
  2. Print Welcome to PowerShell

Your script prints:

Hello World!
Welcome to PowerShell

Try it yourself

# Print the two lines below this comment
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in PowerShell Basics