πŸŽ“ A1Learner
πŸ”
0 of 52 lessons completed

PowerShell Introduction

PowerShell is a command shell for running commands on a computer. It prints the result of each command as text you can read.

Print a greeting

Write-Output prints a value. Start with a greeting.

Write-Output "Hello, PowerShell"

Print a second value

Each command prints its own result. Print one more value.

Write-Output "PowerShell is ready"

Print a fixed date

Get-Date reports a date. The -Date parameter fixes the date it reports.

Get-Date -Date "2026-10-28" -Format "yyyy-MM-dd"

Example

Write-Output "Welcome to PowerShell"
Write-Output "Type a command to begin"
Get-Date -Date "2026-10-28" -Format "yyyy-MM-dd"

Key points

  • Cmdlet: a small built-in command in PowerShell.
  • A command is an instruction you type for PowerShell to run.
  • PowerShell prints the result of each command.
  • Write-Output is a cmdlet that prints a value.
  • A parameter is an extra instruction that changes how a cmdlet works.
  • Commands run one at a time in order from top to bottom.

In this example, the first line prints a welcome message, the second line prints a prompt to begin, and the third line prints a fixed date.

Note

PowerShell runs on Windows, macOS, and Linux.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What does Write-Output do?