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
View the PowerShell Edition and Version
OrientationCurrent 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.
$PSVersionTable.PSEdition$PSVersionTable.PSVersionGet-Location⯠View Expected Console Output
DesktopMajor Minor Build Revision----- ----- ----- --------5 1 26100 1Path----C:\Users\SamStep 2: Find Commands and Read Their Help
Use Get-Command and Get-Help
Learn the ToolsSearch 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.
Get-Command -Noun ProcessGet-Help Get-Process -ExamplesGet-Help Get-ChildItem -Online⯠View Expected Console Output
CommandType Name Version Source----------- ---- ------- ------Cmdlet Get-Process 3.1.0.0 Microsoft.PowerShell.ManagementCmdlet Stop-Process 3.1.0.0 Microsoft.PowerShell.ManagementStep 3: Navigate Folders and Include Hidden Items
Use PowerShell Location and Listing Commands
PathsGet-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.
Set-Location $HOMEGet-LocationGet-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.txtStep 4: Create and Read a Safe Practice File
Work Inside a Lab Folder in Your Profile
PracticeCreate 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.
$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: readyStep 5: Filter and Sort Objects in a Pipeline
Select Properties After Filtering Results
Objects and PipelinesThe 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.
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.34explorer 6112 48.12powershell 9236 2.80