8 Essential PowerShell Commands to Fix Common Windows Issues Fast
Master 8 essential PowerShell commands to fix common Windows issues fast—reset network adapters, flush DNS, clear print queues, repair system files, check activation, free up disk space, and more. Perfect for IT pros and power users.
TOOLS & UTILITES
1. How to Reset Network Adapters in PowerShell
If your internet drops or you're switching between networks and things don’t reconnect properly, this command gives your network adapter a fresh start:
Get-NetAdapter | Disable-NetAdapter -Confirm:$false
Start-Sleep -Seconds 3
Get-NetAdapter | Enable-NetAdapter
Pro tip: No need to reboot. This “soft reset” can fix flaky connections in seconds.
2. PowerShell Command to Flush DNS Cache
Is a website not loading or resolving incorrectly? The DNS cache might be the culprit.
Clear-DnsClientCache
This clears cached DNS entries and forces Windows to query fresh records—great for resolving connection issues or domain changes.
3. Clear Print Queue with PowerShell
Stuck print jobs can cause endless headaches. Here's how to completely flush the print spooler:
Stop-Service -Name Spooler -Force
Remove-Item -Path "C:\Windows\System32\spool\PRINTERS\*" -Force
Start-Service -Name Spooler
This is especially useful when printers hang or say "printing" but nothing happens.
4. Check Windows Activation Status Using PowerShell
Verifying Windows activation is easy—especially after reinstalling or reimaging a system:
slmgr.vbs /xpr
This opens a simple pop-up with your activation status. For more detailed information:
slmgr.vbs /dlv
Helpful for audits, deployments, or troubleshooting licensing issues.
5. Get System Uptime with PowerShell
Want to know how long your PC’s been running?
(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
Great for diagnosing performance issues tied to long uptimes or checking how recently a server was rebooted.
6. List Installed Programs with PowerShell
Quickly generate a list of installed applications:
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher | Format-Table -AutoSize
Useful for system inventory, app audits, or identifying outdated software.
7. Free Up Disk Space by Deleting Temp Files
Cleaning up temporary files can free up gigabytes of space:
Get-ChildItem -Path $env:TEMP -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue
It’s quick, safe, and works well for monthly maintenance routines.
8. Repair Corrupted Windows System Files with PowerShell
Experiencing crashes, update failures, or random errors? Start with:
sfc /scannow
Then follow up with:
DISM /Online /Cleanup-Image /RestoreHealth
These two tools work together to scan for and repair corrupted or missing system files. They’re often the best first step when something just isn’t working right. Click here to learn more about SFC and DISM
How to Run PowerShell as Administrator
Most of these commands require elevated privileges. Here's how to launch PowerShell with admin rights:
Press Windows + X, then choose Windows PowerShell (Admin)
Or search for “PowerShell” in the Start menu, right-click, and select Run as administrator
Final Thoughts: Why Use PowerShell?
PowerShell helps you go beyond the GUI and solve problems faster. Whether you're an IT technician, tech-savvy home user, or someone looking to automate routine maintenance, these commands will save you clicks, time, and stress.
Contact Us
Email: support@desktechpro.com
Get the latest troubleshooting guides and exclusive content straight to your inbox