Skip to main content

PowerShell

Pronunciation
POW-er-shel
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/powershell

In short

PowerShell is Microsoft's command-line shell and scripting language for automating administration, passing objects rather than plain text between commands.

What is PowerShell?

Windows PowerShell 1.0 was released in 2006 as a modern replacement for the old Windows command prompt. In 2016 Microsoft made it open source and cross-platform; the current line, PowerShell 7, runs on Windows, macOS and Linux and is started with the pwsh command.

Its commands, called cmdlets, follow a Verb-Noun pattern that makes them easy to guess: Get-Process, Stop-Service, New-Item. The big difference from Unix shells is the object pipeline. Get-Process | Where-Object CPU -gt 100 | Sort-Object CPU passes .NET objects with properties from one command to the next, so there is no need to parse text with tools such as awk.

PowerShell is the standard way to automate Windows servers, Active Directory, Microsoft 365, Exchange and Azure, and many administrators use it daily. Scripts are saved as .ps1 files, modules are shared through the PowerShell Gallery, and it can call any .NET library directly.

A common misconception is that PowerShell is only for Windows. PowerShell 7 runs on Linux and macOS too, although some Windows-specific modules don't. Its default execution policy on Windows can block unsigned scripts, which surprises newcomers; it is a safety setting, not a sign that scripts are broken.

Key takeaways

  • PowerShell is Microsoft's shell and scripting language, first released in 2006.
  • PowerShell 7 is open source and runs on Windows, macOS and Linux.
  • Cmdlets use Verb-Noun names such as Get-Process.
  • The pipeline passes .NET objects, not text, between commands.
  • It is the standard tool for automating Windows, Microsoft 365 and Azure.

Example

Working with objects in the pipelinepowershell
# The five processes using the most memory, as objects with properties
Get-Process |
  Sort-Object WorkingSet64 -Descending |
  Select-Object -First 5 Name, Id, @{ Name = 'MemoryMB'; Expression = { [math]::Round($_.WorkingSet64 / 1MB) } }

# Find large log files and export the list to CSV
Get-ChildItem -Path C:\Logs -Filter *.log -Recurse |
  Where-Object Length -gt 50MB |
  Export-Csv -Path big-logs.csv -NoTypeInformation

Readers ask

What is the difference between PowerShell and Bash?

Bash passes plain text between commands, while PowerShell passes structured objects. Bash is the standard on Linux and macOS; PowerShell is the standard on Windows and also runs on other systems.

What is the difference between Windows PowerShell and PowerShell 7?

Windows PowerShell 5.1 ships with Windows and is built on the .NET Framework. PowerShell 7 is the newer, open-source, cross-platform version built on modern .NET, and it is where new features are added.

What is a cmdlet?

A built-in PowerShell command, named in Verb-Noun form, such as Get-ChildItem or Set-Location. Cmdlets take parameters and output objects that the next command can use.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings