PowerShell Basics for Windows Administrators
Before you begin
- Applies to:Windows PowerShell administration basics.
- Where to start:Open PowerShell on a Windows practice machine and check its version before running the examples.
- What you need:Use a regular account for read-only exercises. Use an authorized administrator session for steps that require elevation.
Guide tools
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.
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β― Illustrative Output (Results Vary)
DesktopMajor Minor Build Revision----- ----- ----- --------5 1 26100 1Path----C:\Users\SamUse 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β― Illustrative Output (Results Vary)
CommandType Name Version Source----------- ---- ------- ------Cmdlet Get-Process 3.1.0.0 Microsoft.PowerShell.ManagementCmdlet Stop-Process 3.1.0.0 Microsoft.PowerShell.ManagementUse 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β― Illustrative Output (Results Vary)
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.txtWork 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β― Illustrative Output (Results Vary)
Status: readySelect 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β― Illustrative Output (Results Vary)
Name Id CPU---- -- ---chrome 10424 182.34explorer 6112 48.12powershell 9236 2.80References
Your feedback keeps these production procedures accurate and battle-tested.