Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
6.3.2.7. Lab 7: PowerShell Basics
6.3.2.7. Lab 7: PowerShell Basics (45 minutes)
Objective: Execute basic PowerShell commands and understand the object pipeline.
Setup: Windows computer with PowerShell (built-in)
Steps:
-
Check and Set Execution Policy
Get-ExecutionPolicy # If Restricted, run PowerShell as Admin and execute: Set-ExecutionPolicy RemoteSigned -
Basic Commands
# Get help on any command Get-Help Get-Process # List all processes Get-Process # List top 10 processes by CPU usage Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 # List all services Get-Service # List only running services Get-Service | Where-Object {$_.Status -eq "Running"} -
Working with Objects
# Store processes in a variable $procs = Get-Process # Access properties of the first process $procs[0].Name $procs[0].CPU $procs[0].WorkingSet64 / 1MB # Memory in MB -
Create a Simple Script
- Open Notepad and write:
Write-Host "System Information Script" -ForegroundColor Cyan Write-Host "=========================" $os = Get-CimInstance Win32_OperatingSystem Write-Host "Computer: $($os.CSName)" Write-Host "OS: $($os.Caption)" Write-Host "Version: $($os.Version)" - Save as
SystemInfo.ps1on your Desktop - Open PowerShell, navigate to Desktop, run:
.\SystemInfo.ps1
- Open Notepad and write:
Deliverable: Your working SystemInfo.ps1 script.
Written byAlvin Varughese
Founder•15 professional certifications