The Language
Part of the PowerShell Basics section of Coddy's PowerShell journey. Lesson 1 of 28.
PowerShell is a shell and a scripting language made by Microsoft. PowerShell 7 runs on Windows, macOS and Linux, and it is built on .NET, so every value in it is a .NET object.
You type its commands in a terminal, or you save them in a script: a text file whose name ends in .ps1. PowerShell runs a script from the first line to the last.
Its built-in commands are called cmdlets (say "command-lets"). Each name is a verb, a dash and a noun, such as Write-Output, Get-Date or Get-ChildItem, so the name tells you what the command does.
Write-Output "PowerShell is running"
Write-Output "on Linux"Running this script prints:
PowerShell is running
on LinuxIn this course your script is main.ps1, and it runs on PowerShell 7 on Linux. Windows-only features such as services, the registry and Active Directory are named where they matter, but your scripts work with text, numbers, files and data.
Challenge
BeginnerYour first script is ready in main.ps1. Press Run to see what it prints, then press Check.
It prints:
Hello from PowerShell!
Scripts end in .ps1Try it yourself
# Your first PowerShell script
Write-Output "Hello from PowerShell!"
Write-Output "Scripts end in .ps1"
All lessons in PowerShell Basics
5Project: Password Checker
Project OverviewLength Check