PowerShell for Everyday Windows Tasks: A Practical Guide for Users and Businesses
PowerShell looks intimidating the first time you open it.
There is a blinking cursor, no obvious buttons and a very real possibility that the command you type can change something important.
But PowerShell is also one of the most useful Windows troubleshooting and administration tools available.
You can use it to answer practical questions such as:
What is using all the memory?
Is this server reachable on port 443?
How much disk space is left?
Which service has stopped?
Which files changed recently?
Is this downloaded installer really the file the supplier published?
For businesses, PowerShell goes much further. It can collect information from multiple computers, automate repetitive work, manage Microsoft services and create consistent administration processes.
The best way to learn it is not by starting with complicated scripts.
Start with safe, read-only commands that answer useful questions.
Windows PowerShell vs PowerShell 7
This distinction is increasingly important.
Windows 11 still includes Windows PowerShell 5.1 for compatibility with existing Windows administration tools.
Modern PowerShell 7 is developed separately and installed alongside it.
PowerShell 7 is:
actively developed
cross-platform
available for Windows, macOS and Linux
better suited to modern scripting and automation
Microsoft currently recommends WinGet as the preferred installation method on Windows clients.
To see which version you are using:
$PSVersionTable
If you see:
PSEdition Desktop
you are probably using Windows PowerShell 5.1.
If you see:
PSEdition Core
you are using modern PowerShell 7.
That does not mean 5.1 is suddenly useless. Some older Windows modules still depend on it.
For everyday learning and new automation, however, PowerShell 7 is generally the better place to invest your time.
Installing PowerShell 7
On a Windows 11 client with WinGet:
winget install --id Microsoft.PowerShell --source winget
Microsoft currently recommends WinGet for Windows client installations. PowerShell 7 installs side-by-side rather than replacing Windows PowerShell 5.1.
To start it afterwards, search for:
PowerShell
or run:
pwsh
from Windows Terminal.
Learn the Verb-Noun Pattern
PowerShell commands—called cmdlets—usually follow:
Verb-Noun
For example:
Get-Process
Get-Service
Get-ComputerInfo
Test-NetConnection
Restart-Service
The name usually tells you what the command intends to do.
That gives you an immediate safety clue.
Commands beginning with:
Get-
and:
Test-
are generally retrieving or testing information.
Commands beginning with:
Set-
Remove-
Stop-
Restart-
are much more likely to change the system.
That is not an absolute security rule, but it is a useful habit.
1. Find Out What Computer You Are Working On
A useful starting point is:
Get-ComputerInfo |
Select-Object WindowsProductName, WindowsVersion, CsManufacturer, CsModel
This gives you a concise overview of the Windows installation and hardware.
To see when Windows last started:
(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
Or calculate current uptime:
(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
This can be surprisingly useful when somebody insists:
“I restarted it this morning.”
and the machine says it has been running for 19 days.
2. Find What Is Using CPU and Memory
To list processes:
Get-Process
To find the biggest memory consumers:
Get-Process |
Sort-Object WorkingSet64 -Descending |
Select-Object -First 10 Name, Id,
@{Name="MemoryMB";Expression={[math]::Round($_.WorkingSet64 / 1MB,1)}}
To sort by accumulated CPU time:
Get-Process |
Sort-Object CPU -Descending |
Select-Object -First 10 Name, Id, CPU
This is useful when a PC is:
running hot
using loud fans
responding slowly
consuming excessive memory
But remember that CPU here represents accumulated processor time, not the same live percentage displayed in Task Manager.
Use the result as evidence rather than treating the biggest number as automatically faulty.
3. Stop a Frozen Application
First identify it:
Get-Process notepad
Then stop it:
Stop-Process -Name notepad
If necessary:
Stop-Process -Name notepad -Force
Be careful with -Force.
Unsaved work can be lost.
Do not use PowerShell to kill random processes simply because their names are unfamiliar.
4. Check Windows Services
To inspect a service:
Get-Service -Name Spooler
To see stopped services:
Get-Service |
Where-Object Status -eq "Stopped"
If you genuinely know that a service should be restarted:
Restart-Service -Name Spooler
Changing service state often requires administrator rights.
That leads to an important rule:
Do not run PowerShell as Administrator by default.
Most diagnostic commands do not need it.
Elevation should be something you use for a specific task rather than your normal working state.
5. Check the Network Properly
PowerShell is excellent for network troubleshooting.
Start with:
Get-NetIPConfiguration
That can show:
IP address
default gateway
DNS servers
network interface
To check whether a remote service is reachable:
Test-NetConnection hgmssp.com -Port 443
This is more useful than simply using ping when you are actually troubleshooting an application service.
For example:
Test-NetConnection FileServer -Port 445
tests whether SMB file-sharing connectivity is available.
That helps distinguish:
server unreachable
from:
server reachable but application/permission problem.
6. Find Large Files
PowerShell can help investigate disappearing disk space.
For example:
Get-ChildItem "$env:USERPROFILE" -File -Recurse -ErrorAction SilentlyContinue |
Where-Object Length -gt 1GB |
Sort-Object Length -Descending |
Select-Object FullName,
@{Name="SizeGB";Expression={[math]::Round($_.Length / 1GB,2)}}
This can uncover:
forgotten downloads
video files
ISO images
backup archives
large exported datasets
Do not automatically delete the results.
A 20 GB file might be enormous because it is unnecessary.
Or it might be a critical virtual disk.
PowerShell finds the evidence.
You still need to interpret it.
7. Find Files Changed Recently
If you are trying to discover what changed during a problem:
Get-ChildItem "C:\Reports" -File -Recurse -ErrorAction SilentlyContinue |
Where-Object LastWriteTime -gt (Get-Date).AddDays(-7) |
Sort-Object LastWriteTime -Descending
This can be useful for:
finding recently edited documents
investigating application folders
locating new log files
identifying files produced during an incident
Keep the search scope sensible.
Recursively scanning an entire C:\ drive can take a long time and generate a lot of access errors.
8. Check Free Disk Space
A clean disk-space report:
Get-CimInstance Win32_LogicalDisk |
Where-Object DriveType -eq 3 |
Select-Object DeviceID,
@{Name="SizeGB";Expression={[math]::Round($_.Size / 1GB,1)}},
@{Name="FreeGB";Expression={[math]::Round($_.FreeSpace / 1GB,1)}},
@{Name="FreePercent";Expression={
[math]::Round(($_.FreeSpace / $_.Size) * 100,1)
}}
This is much more useful for business monitoring than waiting until Windows reports:
Low disk space.
The real value of PowerShell often appears when a useful one-PC diagnostic later becomes:
run this across 100 managed PCs and report the exceptions.
9. Search Windows Event Logs
To see recent System events:
Get-WinEvent -LogName System -MaxEvents 30
To look for recent errors:
Get-WinEvent -FilterHashtable @{
LogName='System'
Level=2
StartTime=(Get-Date).AddHours(-4)
}
Get-WinEvent is extremely powerful because you can filter large logs before PowerShell returns the results.
But one red Error event does not automatically explain the problem.
Windows logs contain lots of noise.
Look for:
repeated events
timing that matches the fault
relevant provider/source
supporting symptoms
10. Verify Downloaded Files
PowerShell can calculate a cryptographic hash:
Get-FileHash "C:\Downloads\installer.exe" -Algorithm SHA256
You can compare that result against an SHA-256 value published by the software vendor.
If they match, you have evidence that the file you downloaded is identical to the file for which the vendor published that hash.
But remember:
a matching hash is only meaningful when the comparison hash came from a trusted source.
11. Install and Update Software With WinGet
WinGet has become one of the most practically useful command-line tools on Windows 11.
Search for software:
winget search "PowerShell"
List available upgrades:
winget upgrade
Upgrade one known package:
winget upgrade --id Microsoft.PowerShell
WinGet is included with Windows 11 as part of App Installer and can be called directly from PowerShell.
For business environments, software deployment should normally still be governed centrally through tools such as Intune, RMM or another management platform rather than allowing everybody to install whatever they like.
12. Export Results to CSV
This is one of PowerShell's most useful everyday business features.
For example:
Get-Service |
Select-Object Name, DisplayName, Status |
Export-Csv "C:\Reports\Services.csv" -NoTypeInformation
The resulting file opens easily in Excel.
The same technique works for:
devices
processes
accounts
software
services
audit results
PowerShell becomes particularly powerful when it converts troubleshooting information into structured data.
PowerShell's Real Advantage: Objects
This is what makes PowerShell different from an old command shell.
Run:
Get-Service
PowerShell does not merely return lines of formatted text.
It returns service objects.
Those objects have properties such as:
Name
Status
DisplayName
You can therefore write:
Get-Service |
Where-Object Status -eq "Running" |
Sort-Object DisplayName
The pipeline passes structured information from one command to the next.
That is why PowerShell automation can be much more reliable than endlessly parsing text output.
Use -WhatIf Before Destructive Changes
One safety feature deserves much more emphasis than it gets in most introductory guides.
Many PowerShell cmdlets that change things support:
-WhatIf
For example:
Remove-Item "C:\Archive\*.tmp" -WhatIf
Instead of deleting anything, PowerShell shows what the command would attempt.
Some commands also support:
-Confirm
Microsoft specifically provides these through PowerShell's ShouldProcess model so potentially impactful commands can expose preview and confirmation behaviour.
Where available, use them.
The safe pattern is:
inspect → WhatIf → verify → execute
Do Not “Fix” Execution Policy by Setting It to Bypass
This is one area where internet PowerShell guides cause unnecessary problems.
If a script refuses to run, you may find instructions such as:
Set-ExecutionPolicy Bypass
or:
Set-ExecutionPolicy Unrestricted
Do not use those as generic fixes.
First inspect the effective policies:
Get-ExecutionPolicy -List
Microsoft describes execution policy as one part of PowerShell's security strategy, controlling the conditions under which scripts and configuration files load on Windows.
It is important to understand something else:
Execution policy is not a complete security boundary.
Changing it does not suddenly make a malicious script safe.
In a managed business, Group Policy or another security configuration may deliberately control it.
If a trusted downloaded script is merely blocked because Windows marked it as coming from the internet, Microsoft also documents Unblock-File as a more targeted option than weakening the policy for the whole machine.
Be Extremely Cautious With Invoke-Expression
If you are learning PowerShell, you rarely need:
Invoke-Expression
It evaluates text as PowerShell code.
That makes patterns like:
Invoke-Expression $DownloadedText
especially dangerous.
Likewise, be cautious when copying commands that:
download remote content
decode Base64
suppress warnings
change Defender settings
change execution policy
invoke hidden PowerShell processes
PowerShell is a legitimate administration platform, but Microsoft also provides security technologies including AMSI, script-block logging, constrained language capabilities and application control partly because attackers can misuse scripting engines.
PowerShell Remoting Changes the Scale
PowerShell can manage more than the computer in front of you.
Microsoft supports remoting through technologies including WS-Management and SSH, depending on the platform and configuration.
For example, authorised administrators can run commands remotely rather than manually opening every machine.
That is immensely useful.
It also means a mistake can scale.
A command that breaks one laptop is inconvenient.
The same command remotely executed against 200 PCs is an incident.
Business automation therefore needs:
testing
peer review
logging
permissions
staged deployment
rollback
PowerShell gives you scale.
Governance makes that scale safe.
The Best Way to Learn PowerShell
Start with commands that observe:
Get-ComputerInfo
Get-Process
Get-Service
Get-NetIPConfiguration
Test-NetConnection
Get-ChildItem
Get-WinEvent
Get-FileHash
Get-Help
Then learn:
filtering → sorting → selecting → exporting
Only after that move into commands that:
stop
restart
remove
change
automate
The objective is not to memorise hundreds of cmdlets.
It is to learn how to discover and combine them.
For example:
Get-Help Get-WinEvent -Examples
and:
Get-Command *network*
can often teach you more than copying another enormous cheat sheet.
How Hamilton Group Can Help
PowerShell can make Windows administration faster and more consistent, particularly when a business has more than a handful of computers.
Hamilton Group can help with:
Windows administration
PowerShell automation
Microsoft 365
Microsoft Intune
Windows troubleshooting
software deployment
managed IT support
The goal is not simply to automate more things.
It is to automate the right things with testing, logging, security and rollback built into the process.
Visit hgmssp.com or call 01423 438 953 to discuss Windows management and business IT support.
0 comments
- Be the first to comment.