PowerShell is an advanced command-line and scripting program (a shell) developed by Microsoft for task automation and configuration management. Like any command shell, it provides a command-line interpreter for interactive, real-time use and a script interpreter for executing longer scripts in its own dedicated programming language.
Originally known as Windows PowerShell, it was available exclusively for the Windows operating system (built on the .NET Framework). In 2016, however, Microsoft took a major step forward, releasing it as open-source software (PowerShell Core, today simply called PowerShell) and porting it to the modern .NET framework. As a result, it comes pre-installed in all modern versions of Windows (replacing the classic Command Prompt as the default shell since Windows 10 Build 14971), and can also be easily installed and used on Linux and macOS.
How Does It Work Under the Hood?
The main difference between the classic Command Prompt (CMD) and PowerShell lies in how they handle data. While traditional command shells output and pass around plain text, PowerShell is built on the .NET framework and returns objects as the result of every command. This means you can directly filter, sort, and pass the properties of these objects to subsequent commands without complex text parsing.
- Cmdlets (Command Modules): Administrative tasks in PowerShell are performed via specialized .NET classes called cmdlets (pronounced command-lets). They always follow a logical Verb-Noun naming convention (such as
Get-ProcessorStop-Service), which makes them very intuitive to learn. - Providers: These allow you to access various data stores in the exact same way you navigate folders on a drive. Using providers, you can browse the Windows Registry or security certificates with the same commands you use for the file system.
- Pipeline: Using the pipe character (
|), you can send the output of one command directly into another command for further processing. - Remote Management and Hosting: With support for .NET Remoting, WS-Management, CIM, and SSH, administrators can manage hundreds of remote servers from a single machine. Additionally, PowerShell provides a hosting API that allows other applications (such as Microsoft Exchange or SQL Server) to run their graphical management interfaces in the background via PowerShell commands.
Quick Comparison: Classic CMD vs. PowerShell
| Feature | Command Prompt (CMD) | PowerShell |
|---|---|---|
| Output Type | Plain Text | .NET Framework Objects |
| Supported Systems | Windows Only | Windows, Linux, and macOS |
| Registry Access | Requires dedicated tools (reg.exe) | Directly like folders (cd HKLM:) |
| Automation | Basic .bat batch files | Advanced .ps1 scripts and modules |
Practical Examples You Can Try Right Away
You can safely test all of the commands below in your own PowerShell window. None of them modify or delete any data—they are strictly for reading and displaying information about your system.
1. List installed Microsoft Store apps (Windows only):
The first part of the command retrieves all installed Windows apps, while the | symbol passes the result to Select-Object, displaying only the app name and its full system package name.
Get-AppxPackage | Select-Object Name, PackageFullName
2. Find the top 5 most memory-intensive processes (RAM):
Here you can see the true power of the pipeline. It fetches all active processes, sorts them in descending order by working memory usage (WorkingSet), and displays only the top five (works on both Windows and Linux).
Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 5 Name, CPU, WorkingSet
3. View all active system services (Windows only):
This command checks all services in the operating system and uses the Where-Object filter to show only those that are currently running.
Get-Service | Where-Object {$_.Status -eq "Running"}
4. Test network connectivity and open ports:
A modern replacement for the classic ping command that also checks whether a specific service (such as a website on port 443) is reachable.
Test-NetConnection -ComputerName vadnica.org -Port 443
How to Find Help Directly in the Terminal?
One of PowerShell's best features is its built-in documentation. If you aren't sure which parameters a command accepts, simply use the Get-Help command to display its description and practical usage examples right inside the terminal:
Get-Help Get-Process -Examples
How to Install PowerShell on Linux?
Because PowerShell is open-source and built on the modern .NET framework, you can easily install it on your Linux distribution as well.
Arch Linux (via AUR):
The package is not in the official pacman repositories, so the fastest way to install it is from the AUR using an AUR helper like paru (or yay):
paru -S powershell-bin
If you don't use an AUR helper, you can build the package manually using makepkg:
sudo pacman -S --needed git base-devel git clone https://aur.archlinux.org/powershell-bin.git cd powershell-bin makepkg -si
On Linux, the program does not create a graphical icon in your application menu. Once the installation is complete, open your regular terminal and launch PowerShell with the following command:
pwsh
Your command prompt will change to PS /home/user>, meaning you can immediately start running PowerShell commands (to exit back to your regular terminal, simply type exit).
Ubuntu and Debian:
The quickest method on systems that support Snap packages is a single command:
sudo snap install powershell --classic
If you prefer using the official package manager (APT), first add the Microsoft repository and then install the package:
sudo apt update && sudo apt install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt update sudo apt install -y powershell
Fedora and RHEL:
Install it directly using the dnf package manager:
sudo dnf install -y powershell
On Ubuntu, Debian, and Fedora systems, you also launch the shell in your terminal after installation by running pwsh.