๐ Introduction
If youโve used Windows for years, chances are you rely on the GUI for most tasksโclicking around Control Panel, Task Manager, File Explorer, or downloading random utilities to get things done. But what if I told you that Windows already has a Swiss Army knife built-in, hidden in plain sight?
That tool is PowerShell.
Originally introduced as a system administration tool, PowerShell has evolved into one of the most powerful scripting languages and automation frameworks on Windows (and now cross-platform via PowerShell Core).
In this mega-guide, Iโll share 55+ real-world PowerShell hacks you can use right away. These arenโt boring โHello Worldโ scripts โ these are battle-tested tricks for:
- ๐ System Administration (managing Windows without endless clicking)
- ๐ Networking (IP tricks, scanning, monitoring)
- ๐ Ethical Hacking & Security (Wi-Fi passwords, hashes, user hunting)
- โ๏ธ Automation & Productivity (scripting your life away)
- ๐ ๏ธ Advanced Power Hacks (become a Windows wizard)
Letโs dive in.
๐ฅ๏ธ System Administration Hacks
1. Merge System + User PATH
Sometimes apps break because Windows PATH variables get messed up. This one-liner rebuilds PATH by merging Machine + User scopes.
$env:PATH = [System.Environment]::GetEnvironmentVariable('PATH','Machine') + ';' +
[System.Environment]::GetEnvironmentVariable('PATH','User')
๐ Use Case: Fix missing executables (like Git or Node.js) when PATH corruption happens.
2. List Installed Programs
Instead of scrolling through Control Panel โ Programs, just run:
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select DisplayName, DisplayVersion
๐ Pro Tip: Pipe to Export-Csv
for inventory reports.
3. Clear Temp Files Instantly
Remove-Item "$env:TEMP\*" -Force -Recurse -ErrorAction SilentlyContinue
๐ Free up space without CCleaner.
4. Restart Explorer (Fix Frozen Taskbar/Desktop)
Stop-Process -Name explorer -Force; Start-Process explorer
โก Fixes unresponsive Explorer without reboot.
5. Find Large Files (>500MB)
Get-ChildItem C:\ -Recurse -ErrorAction SilentlyContinue |
Where-Object { $_.Length -gt 500MB } |
Select FullName, Length
๐ Perfect for tracking down space hogs.
(... continue with System Admin hacks 6โ10, adding explanations, practical scenarios, and pro tips...)
๐ Networking Hacks
11. Get Your Public IP
(Invoke-WebRequest -Uri "https://api.ipify.org").Content
๐ No browser required.
12. Ping Sweep a Subnet
1..254 | ForEach-Object {
Test-Connection "192.168.1.$_" -Count 1 -Quiet |
ForEach-Object { if ($_){Write-Output "192.168.1.$_ UP"}} }
๐ก Use Case: Discover live hosts on your LAN.
(... cover Networking hacks 13โ20 with storytelling, practical use cases...)
๐ Ethical Hacking & Security Hacks
21. Show All Saved Wi-Fi Passwords
(netsh wlan show profiles) | ForEach-Object {
if ($_ -match "All User Profile\s*:\s*(.*)") {
$name = $matches[1]
netsh wlan show profile name="$name" key=clear | Select-String "Key Content"
}
}
๐ Real World: Recover forgotten Wi-Fi keys without resetting the router.
23. Hash a File (SHA256, MD5)
Get-FileHash C:\path\to\file.txt -Algorithm SHA256
๐ Great for verifying downloads or malware samples.
(... continue with 24โ30 security hacks, linking them to sysadmin/ethical hacking scenarios...)
โ๏ธ Automation & Productivity Hacks
31. Clipboard to File
Get-Clipboard | Out-File C:\clipboard.txt
๐ Turn clipboard into instant notes.
37. Batch Rename Files
Dir *.jpg | % {Rename-Item $_ -NewName ("Photo_" + $_.Name)}
๐ Bulk rename like a pro.
39. Monitor File Changes in Real-Time
$fsw = New-Object IO.FileSystemWatcher "C:\Path","*.txt" -Property @{IncludeSubdirectories=$true;EnableRaisingEvents=$true}
Register-ObjectEvent $fsw Changed -Action {Write-Host "File changed: $($EventArgs.FullPath)"}
โก Watch logs, configs, or project files.
(... continue with 31โ40 productivity hacks...)
๐ ๏ธ Advanced Power Hacks
42. Generate Random Password
-join ((33..126) | Get-Random -Count 16 | % {[char]$_})
๐ Strong password in one line.
47. Check GPU Usage
Get-Counter -Counter "\GPU Engine(*)\Utilization Percentage"
๐ฎ Monitor GPU without Task Manager.
52. Enable Remote Desktop
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0
๐ Instantly enable RDP.
55. Self-Destruct Script
Start-Sleep 3; Remove-Item $MyInvocation.MyCommand.Source
๐ฃ Script cleans itself up after execution.
๐ Conclusion
PowerShell is far more than โanother command line.โ With these 55+ hacks, you can:
- Manage Windows like a sysadmin.
- Automate boring tasks.
- Perform networking diagnostics.
- Do ethical hacking/security checks.
- Unlock hidden capabilities of your PC.
Once you start using PowerShell this way, youโll wonder why you ever reached for the mouse.
Top comments (0)