Skip to content

PowerShell Basics for Windows Administrators

PowerShell is a command shell and scripting language. Many built-in commands use a Verb-Noun name, such as Get-Process. Unlike a traditional text-only pipeline, PowerShell passes .NET objects between commands, so you can select properties and sort results without parsing screen text.

The examples use read-only commands first, then create a small practice folder under your user profile. You do not need an administrator session for this guide.


Step 1: Check Which PowerShell You Opened

01

View the PowerShell Edition and Version

Orientation

Current Windows client and server releases include Windows PowerShell 5.1; older Windows versions may include an earlier release. PowerShell 7 is a separate product that can be installed side by side and is launched with pwsh. Commands and modules can differ between editions, so check the session before following instructions written for a specific version.

Terminal window
$PSVersionTable.PSEdition
$PSVersionTable.PSVersion
Get-Location
❯ View Expected Console Output
Desktop
Major Minor Build Revision
----- ----- ----- --------
5 1 26100 1
Path
----
C:\Users\Sam

Step 2: Find Commands and Read Their Help

02

Use Get-Command and Get-Help

Learn the Tools

Search command names with Get-Command, then read syntax or examples with Get-Help. Local help may show only a short summary if help files are not installed; -Online opens the official help page in a browser.

Terminal window
Get-Command -Noun Process
Get-Help Get-Process -Examples
Get-Help Get-ChildItem -Online
❯ View Expected Console Output
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-Process 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Stop-Process 3.1.0.0 Microsoft.PowerShell.Management

Step 3: Navigate Folders and Include Hidden Items

03

Use PowerShell Location and Listing Commands

Paths

Get-Location shows the current directory, Set-Location changes it, and Get-ChildItem lists its contents. The common aliases are pwd, cd, and dir. Add -Force to include hidden items; it does not bypass access permissions.

Terminal window
Set-Location $HOME
Get-Location
Get-ChildItem -Force | Select-Object Mode, Length, LastWriteTime, Name
❯ View Expected Console Output
Path
----
C:\Users\Sam
Mode Length LastWriteTime Name
---- ------ ------------- ----
d----- 10/05/2026 9:00 AM Documents
-a---- 284 10/04/2026 4:12 PM notes.txt

Step 4: Create and Read a Safe Practice File

04

Work Inside a Lab Folder in Your Profile

Practice

Create a dedicated folder under your profile, write a sample file, and read it back. Set-Content replaces the file if it already exists, so the example uses a new lab file name. Review a target path before using a command that overwrites or removes files.

Terminal window
$Lab = Join-Path $HOME 'PowerShell-Basics-Lab'
New-Item -ItemType Directory -Path $Lab -Force
$SampleFile = Join-Path $Lab 'status.txt'
Set-Content -LiteralPath $SampleFile -Value 'Status: ready'
Get-Content -LiteralPath $SampleFile
❯ View Expected Console Output
Status: ready

Step 5: Filter and Sort Objects in a Pipeline

05

Select Properties After Filtering Results

Objects and Pipelines

The pipeline operator | passes objects to the next command. Here, Where-Object filters running processes, Sort-Object orders them by accumulated CPU time, and Select-Object chooses columns to display. The CPU value is not an instantaneous percentage.

Terminal window
Get-Process |
Where-Object { $_.CPU -ne $null } |
Sort-Object CPU -Descending |
Select-Object -First 5 Name, Id, CPU
❯ View Expected Console Output
Name Id CPU
---- -- ---
chrome 10424 182.34
explorer 6112 48.12
powershell 9236 2.80

References

Comments