Skip to content
BENIBIX Learn

PowerShell

Development🔤 LanguagesPopular Languages

Also known as Windows PowerShell, PowerShell Script, pwsh, .ps1 File

A shell and script language that passes data with named parts, not plain text.

Think of it like

Most shells hand you loose notes. This one hands you boxes with tags on them.

Example

Microsoft makes PowerShell. An admin uses one line of it to list the three programs using the most CPU. Each result has named parts, like Name and CPU.

Why it matters

Most Windows and Azure admin work is done in it. Objects make long chains of commands safer.

Definition

PowerShell is a shell and scripting language for automating computer jobs. Most shells pass plain text from one command to the next. PowerShell passes whole objects, with named parts, so you do not have to cut text up. It runs on Windows, Linux and macOS. It is widely used to manage Windows machines and cloud services.

Example code

powershell
Get-Process | Sort-Object CPU -Descending | Select-Object -First 3
Get every program, sort by CPU use, and keep the top three.
PowerShell sits on the shell and scripting shelf.

Common mistake

Running a script downloaded from the web without reading it. Scripts can change anything the user can.

Key takeaways

  1. 1
    Objects, not text. Results have named parts.
  2. 2
    Verb-Noun names. Like Get-Process.
  3. 3
    Runs everywhere. Windows, Linux and macOS.

Compare

Learn it properly