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 42Good morning
42Text 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
BeginnerWrite a script that prints two lines.
- Print
Hello World! - Print
Welcome to PowerShell
Your script prints:
Hello World!
Welcome to PowerShellTry it yourself
# Print the two lines below this comment
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in PowerShell Basics
5Project: Password Checker
Project OverviewLength Check