Getting Started with PowerShell: Your First Commands
PowerShell seems intimidating, but you only need 5 commands to become productive. Let's start with the foundation.
How It Works
PowerShell is a command-line tool where you type commands instead of clicking. Each command does one job well. The prompt (>) waits for you to type commands.
Your first three commands answer basic questions: Where am I? What's here? How do I get there?
Code Examples
See Your Current Folder
# Ask PowerShell: where am I right now?
Get-Location
# Output: C:\Users\YourName
# Shortcut (same command):
pwd
List What's in This Folder
# Ask PowerShell: what files and folders are here?
Get-ChildItem
# Output shows:
# Name LastWriteTime Length
# Documents 3/20/2026 10:15 AM
# report.txt 3/18/2026 2:45 PM 4521
# Shortcuts (same command):
ls
dir
Move to a Different Folder
# Go into Documents folder
Set-Location Documents
# Now your prompt shows:
# PS C:\Users\YourName\Documents>
# Shortcut:
cd Documents
# Go back to parent folder
cd ..
# Go to your home folder
cd ~
Create a New Folder
# Create a folder called "MyProject"
New-Item -ItemType Directory -Name "MyProject"
# Go into it
cd MyProject
Most Used Options
- pwd / Get-Location - See where you are right now
- ls / Get-ChildItem - List files and folders here
- cd / Set-Location - Move to different folder
- cd .. - Go up one level
- New-Item -ItemType Directory - Create a folder
The Trick: Power Usage
Combine commands to understand your location:
# See where you are
pwd
# See what's here
ls
# Now you're oriented!
Tab completion saves typing: Type part of a path and press TAB:
cd Doc[TAB] # Becomes: cd Documents
Use this every timeโsaves hundreds of keystrokes!
Learn It Through Practice
Stop reading and start practicing:
The interactive environment lets you type these commands and see real results.
Part of PowerShell for Beginners
This is part of the PowerShell for Beginners series:
- Getting Started - Your first commands
- Command Discovery - Find what exists
- Getting Help - Understand commands
- Working with Files - Copy, move, delete
- Filtering Data - Where-Object and Select-Object
- Pipelines - Chain commands together
Related Resources
Summary
You now understand:
- How this command works
- The most useful options
- One powerful trick
- Where to practice hands-on
Practice these examples until they're automatic. Mastery comes from repetition.
Practice now: Head to the interactive environment and try these commands yourself. That's how PowerShell clicks for you!
What would you like to master next?
Top comments (0)