Cmdlets and Commands

Understand PowerShell cmdlets, the Verb-Noun naming convention, how to discover commands, and get help. Master the fundamental building blocks of PowerShell.

📖 5 min read📅 2026-02-10Core Concepts

What are Cmdlets?

Cmdlets (pronounced "command-lets") are the fundamental building blocks of PowerShell. They are lightweight commands that perform specific actions and follow a consistent Verb-Noun naming pattern.

# Verb-Noun pattern examples
Get-Process        # Get = Verb, Process = Noun
Set-Location       # Set = Verb, Location = Noun
New-Item           # New = Verb, Item = Noun
Remove-Item        # Remove = Verb, Item = Noun

This naming convention makes cmdlets predictable and discoverable. If you know the verb and noun, you can often guess the command name.

Common Verbs

PowerShell uses a standard set of approved verbs:

VerbPurposeExample
GetRetrieve dataGet-Process, Get-Service
SetModify dataSet-Location, Set-Content
NewCreate somethingNew-Item, New-Object
RemoveDelete somethingRemove-Item, Remove-Variable
StartBegin an actionStart-Process, Start-Service
StopEnd an actionStop-Process, Stop-Service
RestartStop then startRestart-Service, Restart-Computer
TestVerify/checkTest-Path, Test-Connection
InvokeExecute an actionInvoke-Command, Invoke-WebRequest
ExportSave to a formatExport-Csv, Export-Clixml
ImportLoad from a formatImport-Csv, Import-Module
ConvertToConvert formatConvertTo-Json, ConvertTo-Html
ConvertFromConvert from formatConvertFrom-Json, ConvertFrom-Csv

To see all approved verbs:

Get-Verb

Discovering Commands

Find All Available Commands

# List all commands
Get-Command
 
# Count total available commands
(Get-Command).Count
 
# List only cmdlets
Get-Command -CommandType Cmdlet
 
# List only functions
Get-Command -CommandType Function

Search for Specific Commands

# Find commands related to "process"
Get-Command *process*
 
# Find all "Get" commands
Get-Command -Verb Get
 
# Find all commands working with "Service"
Get-Command -Noun Service
 
# Find commands in a specific module
Get-Command -Module Microsoft.PowerShell.Management

Getting Help

PowerShell has an excellent built-in help system. Always use it when you're unsure about a command.

Update Help Files

# Download the latest help files (run as Administrator)
Update-Help -Force

Using Get-Help

# Basic help
Get-Help Get-Process
 
# Detailed help with examples
Get-Help Get-Process -Detailed
 
# Show only examples
Get-Help Get-Process -Examples
 
# Full technical documentation
Get-Help Get-Process -Full
 
# Open help in a browser window
Get-Help Get-Process -Online

Understanding Help Output

# Get-Help shows:
# NAME        - Command name
# SYNOPSIS    - Brief description
# SYNTAX      - How to use it (parameters)
# DESCRIPTION - Detailed explanation
# PARAMETERS  - Each parameter explained
# EXAMPLES    - Usage examples

Parameters

Cmdlets accept parameters to modify their behavior. Parameters use a dash prefix:

# Named parameters
Get-Process -Name "notepad"
 
# Multiple parameters
Get-ChildItem -Path "C:\Users" -Recurse -Filter "*.txt"
 
# Positional parameters (order matters)
Get-Process notepad        # -Name is positional, so you can skip it
 
# Switch parameters (no value needed)
Get-ChildItem -Recurse     # -Recurse is a switch (on/off)

Common Parameters

Every cmdlet supports these common parameters:

# -Verbose: Show detailed operation info
Get-Process -Verbose
 
# -WhatIf: Preview what would happen (doesn't execute)
Remove-Item "test.txt" -WhatIf
 
# -Confirm: Ask before executing
Remove-Item "test.txt" -Confirm
 
# -ErrorAction: Control error behavior
Get-Process -Name "nonexistent" -ErrorAction SilentlyContinue
 
# -OutVariable: Store output in a variable
Get-Process -OutVariable allProcesses

Aliases

Aliases are shortcuts for cmdlets. PowerShell includes many built-in aliases:

# Common aliases
ls          # Get-ChildItem
dir         # Get-ChildItem
cd          # Set-Location
pwd         # Get-Location
cat         # Get-Content
echo        # Write-Output
cls         # Clear-Host
cp          # Copy-Item
mv          # Move-Item
rm          # Remove-Item
mkdir       # New-Item -ItemType Directory
 
# See all aliases
Get-Alias
 
# Find the alias for a cmdlet
Get-Alias -Definition Get-ChildItem
 
# Find what an alias maps to
Get-Alias ls
 
# Create your own alias
Set-Alias -Name np -Value notepad
Set-Alias -Name g -Value git

Best Practice: Use full cmdlet names in scripts for readability. Use aliases only in the interactive console for speed.

Running External Commands

You can run traditional commands and executables from PowerShell:

# Run native commands
ipconfig /all
ping google.com
nslookup example.com
 
# Run executables
notepad.exe
code .
 
# Run with arguments
git status
git log --oneline -10
 
# Use the call operator (&) for paths with spaces
& "C:\Program Files\MyApp\app.exe"

Command History

# View command history
Get-History
 
# Search history
Get-History | Where-Object { $_.CommandLine -like "*process*" }
 
# Re-run a command by ID
Invoke-History 5
 
# Clear history
Clear-History

Practical Examples

Example 1: Explore Your System

# What version of PowerShell am I running?
$PSVersionTable.PSVersion
 
# What OS am I on?
$PSVersionTable.OS
 
# How many commands are available?
(Get-Command).Count
 
# What modules are loaded?
Get-Module

Example 2: Find the Right Command

# I want to work with files...
Get-Command -Noun Item
 
# I want to get information about something...
Get-Command -Verb Get -Noun *computer*
 
# What can I do with services?
Get-Command *service*

Example 3: Understand a Command

# What does Get-Service do?
Get-Help Get-Service -Examples
 
# What parameters does it accept?
(Get-Command Get-Service).Parameters.Keys

Exercises

Try these on your own:

  1. Find all cmdlets that contain the word "content"
  2. Use Get-Help to learn about Test-Connection
  3. Create an alias called procs that maps to Get-Process
  4. Find out what the alias gci maps to
  5. Count how many "Get" commands are available on your system

In the next tutorial, we'll explore the PowerShell Pipeline — the most powerful feature of PowerShell!