A command-line interface is a text-based way to interact with a computer or another machine. A shell accepts commands, runs command-line utilities, and displays results immediately. A terminal is the application that hosts the shell, so the two are related but distinct. section 1.0 section 2.0
PowerShell supports interactive command use before scripting. Type a command, add parameters, press Enter, and inspect the result. When a command becomes repetitive, save it in a .ps1 file and run it as a script. section 4.2
A practical command-line workflow is:
- Run a command. section 12.5
- Examine the results. section 12.5
- Recall and modify the command when the output is unexpected. section 12.5
- Combine commands with pipelines to filter, sort, select, or measure results. section 12.5
Inspect and refine processes
Start with Get-Process, then filter out PowerShell processes, sort by virtual memory, and select the first ten results. Each step can be tested immediately before adding the next. section 12.5
Get-Process | Where-Object { $_.Name -notlike 'pwsh*' } |
Sort-Object VM -Descending
Shows a runnable pipeline that filters processes and sorts them by virtual memory in descending order. section 12.5








