100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

What Is PowerShell?

An introduction to PowerShell as Microsoft's object-oriented shell and scripting language, covering what sets it apart from traditional command-line tools.

FoundationsBeginner7 min readJul 10, 2026
Analogies

What Is PowerShell?

PowerShell is a cross-platform command-line shell and scripting language built on .NET, created by Microsoft to automate administration of Windows and, since PowerShell Core (6+, now PowerShell 7), Linux and macOS too. Unlike traditional shells that pass plain text between commands, PowerShell passes structured .NET objects, so a command's output retains properties and methods that the next command can use directly rather than having to be re-parsed from text.

🏏

Cricket analogy: Like the DRS system in cricket that shows ball-tracking data, not just an umpire's word, PowerShell hands the next command real structured data (an object) instead of a plain text verdict, so Sort-Object can read exact values the way Hawk-Eye readings feed replay analysis.

PowerShell as a Shell and Scripting Language

PowerShell has a dual nature: it's an interactive shell where you type cmdlets like Get-Process one at a time and see immediate results, and it's a full scripting language where those same cmdlets, plus variables, loops, and functions, are saved into .ps1 files and executed as a complete program. Both modes share identical syntax, so anything you learn typing interactively transfers directly to writing scripts.

🏏

Cricket analogy: Practising in the nets gives instant feedback shot by shot, much like typing cmdlets interactively, while a coach's pre-written match plan for a five-day Test is like a .ps1 script executed as a whole from start to finish.

The Object Pipeline

The pipe operator (|) chains cmdlets together so the full object output of one becomes the input of the next, for example Get-Process | Where-Object {$_.CPU -gt 100} | Sort-Object CPU. Because real .NET objects flow through the pipe rather than text, Where-Object can filter on the actual numeric CPU property and Sort-Object can order by it correctly, with no text parsing in between.

🏏

Cricket analogy: A fielding relay throw passes the ball hand to hand from boundary to keeper, each fielder adding no distortion - PowerShell's pipeline passes a full object like a Get-Process result from Where-Object to Sort-Object with every property intact, not just a shouted score.

PowerShell cmdlets are thin wrappers around .NET classes and methods. When you run Get-Process, you're really instantiating .NET's System.Diagnostics.Process class under the hood - which is why every object PowerShell returns has rich, inspectable properties instead of a fixed text format.

PowerShell vs Command Prompt vs Bash

Windows' cmd.exe is a legacy text-based shell with a limited, largely non-extensible scripting model (.bat files). Bash, dominant on Linux and macOS, is far more powerful for text manipulation with tools like awk, sed, and grep, but everything it passes between commands is still plain text. PowerShell instead builds discoverability directly into the object model: piping any command's output into Get-Member instantly lists every property and method that object actually has, so you rarely need external documentation to know what data is available.

🏏

Cricket analogy: Comparing a basic scoreboard (runs and wickets only) to a full Hawk-Eye analytics dashboard (spin rate, seam angle, pitch map) is like comparing cmd.exe's plain text to PowerShell's Get-Member, which reveals every property and method an object actually carries.

When a PowerShell cmdlet wraps a native external command (like ping.exe or git.exe), the output reverts to plain text because the external tool itself is text-based. Piping that output into Where-Object or Sort-Object as if it were structured objects will silently fail to filter or sort meaningfully - you'll need to parse it as text or use a native PowerShell-aware alternative.

powershell
# List the five processes using the most CPU time
Get-Process |
    Where-Object { $_.CPU -gt 10 } |
    Sort-Object CPU -Descending |
    Select-Object -First 5 Name, CPU, Id

# Inspect exactly what properties an object exposes
Get-Process -Name pwsh | Get-Member -MemberType Property
  • PowerShell is Microsoft's cross-platform shell and scripting language, built on .NET.
  • It passes structured .NET objects through its pipeline instead of plain text.
  • The same syntax works both interactively at the console and in saved .ps1 scripts.
  • The pipe operator (|) chains cmdlets, feeding one cmdlet's object output as the next cmdlet's input.
  • Get-Member lists every property and method an object actually has, aiding discoverability.
  • Wrapped native/external commands still output plain text, unlike native PowerShell cmdlets.
  • PowerShell 7+ (pwsh) is cross-platform; legacy Windows PowerShell 5.1 is Windows-only.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#PowerShellStudyNotes#WhatIsPowerShell#PowerShell#Shell#Scripting#Language#StudyNotes#SkillVeris#ExamPrep