These seven PowerShell commands cover the things most Windows users end up needing — full system specs, bulk app updates, killing runaway processes, removing Microsoft bloatware, restarting the print spooler, checking active network connections, and chaining DISM with SFC and an automatic restart. Every command works on Windows 10 and Windows 11 with the built-in Windows PowerShell 5.1 — no install, no PowerShell 7 required.
Applies to: Windows 10 (22H2) and Windows 11 (23H2, 24H2, 25H2) | Last updated: May 13, 2026
Key Takeaways
- Get-ComputerInfo returns full system specs (CPU, RAM, BIOS, Windows edition, install date) without installing a third-party tool.
- winget upgrade –all –accept-package-agreements –accept-source-agreements updates every winget-managed app on the system in one command, with no Y/N prompts.
- Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 shows the top five CPU hogs even when Task Manager is too slow to open.
- Get-AppxPackage piped to Remove-AppxPackage removes built-in Microsoft apps (including the Microsoft Store) that the Settings app refuses to uninstall.
- Restart-Service spooler restarts the print spooler in one line — much faster than opening the Services panel.
- Get-NetTCPConnection -State Established and netstat -nob together show every active network connection and which app owns it — useful for privacy checks and malware detection.
- Chaining commands with semicolons (DISM ; SFC ; shutdown /r /t 0) runs DISM, then SFC, then auto-restarts the PC — no manual steps between each phase.
Quick Steps
- Right-click the Start button and pick Terminal (Admin) on Windows 11, or search for Windows PowerShell and run as administrator on Windows 10.
- Run
Get-ComputerInfofor full system specs. - Run
winget upgrade --all --accept-package-agreements --accept-source-agreementsto update everything at once. - Run
Get-Process | Sort-Object CPU -Descending | Select-Object -First 5to find the top CPU consumers, thenStop-Process -Name "ProcessName"to kill one. - Run
Get-AppxPackage -Name "Microsoft.WindowsStore" | Remove-AppxPackageto uninstall built-in apps Settings won’t remove. - Run
Restart-Service spoolerto fix print spooler problems instantly. - Run
Get-NetTCPConnection -State Establishedandnetstat -nobto see every active network connection and which app owns it. - Chain DISM, SFC, and a restart in one shot:
DISM /Online /Cleanup-Image /RestoreHealth ; SFC /scannow ; shutdown /r /t 0.
A Quick Note on PowerShell 5.1 vs PowerShell 7
Windows 10 and Windows 11 both ship with Windows PowerShell 5.1 built in. Every command in this guide runs in that version — you do not need to install PowerShell 7. PowerShell 7+ is a newer, cross-platform release of the same shell, and it is worth having for advanced scripting, but it is a separate install.
If you do want PowerShell 7, the official Microsoft documentation on installing PowerShell on Windows walks through the supported install methods, and the latest builds live on the PowerShell GitHub releases page. For everything below, the built-in shell is enough.
How to Open Windows PowerShell as Administrator
On Windows 11, right-click the Start button and choose Terminal (Admin). Windows Terminal opens to a Windows PowerShell tab by default, already elevated. On Windows 10, search for Windows PowerShell in the Start menu (not Windows PowerShell ISE), right-click it, and pick Run as administrator.
If you don’t see Terminal or PowerShell in the Start button menu, the search method works on every supported version of Windows 10 and Windows 11. Hold Ctrl and scroll up on the mouse wheel inside the window to enlarge the font — small thing, but it makes a real difference if you’re working through a long output.
Command 1: Get-ComputerInfo — Full System Specs in One Line
When you need a full breakdown of a PC — CPU, RAM, BIOS version, Windows edition, install date, OS language, architecture — and you don’t want to install Speccy or another third-party tool, run this:
Get-ComputerInfo
The command dumps everything in one long block. You’ll see the Windows Edition ID (Professional, Home, Enterprise), the OS display version (e.g. 25H2), BIOS information, OS architecture (64-bit or 32-bit), and the OS language. On a virtual machine you’ll see VM-reported hardware; on bare metal you’ll see the real CPU and motherboard details.
Tip: The output is long. Pipe it into
more(Get-ComputerInfo | more) to page through it, or filter to specific properties — for exampleGet-ComputerInfo | Select-Object OsName, OsVersion, CsTotalPhysicalMemory— when you only want a few fields.
Command 2: winget upgrade — Update Every App Without the Prompts
winget is Microsoft’s built-in package manager — it ships pre-installed and works out of the box on Windows 11. To list every app on the system that has a winget update available:
winget upgrade
That just shows the list. To actually install all of them in one shot, with no Y/N prompts, run:
winget upgrade --all --accept-package-agreements --accept-source-agreements
The two --accept flags are what make this hands-off. Without them, winget pauses at every package and waits for you to type Y. With them, it just downloads and installs the lot one after another, and reports back when it is done.
Note: winget only updates apps that exist in the winget repository. Anything you installed manually from a vendor’s site that isn’t in winget will be invisible to this command. On a fresh Windows 10 install, winget may not be present yet — Windows 11 has it ready by default.
Command 3: Find the Top CPU Hogs (and Kill One) Without Task Manager
When the PC is so slow that Task Manager won’t even open, PowerShell can still tell you what is eating the CPU. This command grabs every process, sorts by CPU usage descending, and shows the top five:
Get-Process | Sort-Object CPU -Descending | Select-Object -First 5
Once you have a process name from that output, end it without going anywhere near Task Manager:
Stop-Process -Name "msedge"
Replace msedge with the process name shown by Get-Process. Run the get-process command again afterwards to confirm it is gone. In a computer repair context this combination is gold — when a system is so loaded that the GUI is unresponsive, you can still free resources from the shell.
Command 4: Remove Built-in Microsoft Apps (Even the Ones Settings Won’t Touch)
The Microsoft Store, Xbox Game Bar, and several other built-in apps don’t expose an Uninstall option in Settings > Apps > Installed apps. PowerShell does. First, find the exact package name with a wildcard search — the example below looks for anything with “store” in the name:
Get-AppxPackage -Name "*store*"
That returns full package details for every match. Copy the exact Name field of the package you want to remove (for example Microsoft.WindowsStore), then pipe it into Remove-AppxPackage:
Get-AppxPackage -Name "Microsoft.WindowsStore" | Remove-AppxPackage
That removes the package for the current user. To remove it for every user account on the machine, add -AllUsers:
Get-AppxPackage -Name "Microsoft.WindowsStore" -AllUsers | Remove-AppxPackage -AllUsers
Heads-up: Some system packages are protected and won’t remove no matter what. If a removal fails, leave that one alone — forcing it usually breaks more than it fixes. The Store example above is for demonstration; do not uninstall the Microsoft Store unless you have a specific reason and know how to get it back.
This is exactly how debloating tools work under the hood — they build a list of package names and run the same Get-AppxPackage / Remove-AppxPackage pair against each one. If you’d rather not type these out for every app you want gone, my Winhance app wraps this whole process in a UI, with the option to keep removed apps from coming back after Windows updates. There’s also a written walkthrough of removing Windows bloatware without third-party software if you want to stay fully manual.
Command 5: Restart-Service spooler — Fix Printer Problems in One Line
Anyone who has supported printers knows the routine: search for “services,” wait for the Services panel to open, scroll to Print Spooler, right-click, restart. PowerShell collapses all of that into:
Restart-Service spooler
It runs silently — no confirmation message — so to verify the service came back up, check its state:
Get-Service spooler
If a print job is stuck in the queue, restarting alone usually isn’t enough — you need to stop the spooler, clear the stuck jobs from C:\Windows\System32\spool\PRINTERS, then start it again:
Stop-Service spooler
# clear stuck files in C:\Windows\System32\spool\PRINTERS
Start-Service spooler
The same Get-Service, Restart-Service, Stop-Service, and Start-Service cmdlets work for any Windows service — replace spooler with the service name. Hours of repair-shop time would have been saved if I’d known about these earlier.
Command 6: See Every Active Network Connection and Who Owns It
For privacy checks, malware investigation, or just curiosity about what your PC is talking to, this PowerShell-native command lists every established TCP connection along with the local and remote address, ports, and the owning process ID:
Get-NetTCPConnection -State Established
That gives you process IDs, but not the friendly app name. The older netstat command fills that gap — run it alongside the PowerShell version to see exactly which executable owns each connection:
netstat -nob
The -nob flags display addresses numerically and show the owning executable for each connection. You’ll see entries like msedge.exe, svchost.exe, and the start menu host process, each tied to specific connections. For some lower-level connections Windows may not surface the owning process — that’s normal and not a sign of anything wrong.
Used together, these two commands are pure gold for diagnosing whether a system is reaching out to anything it shouldn’t. If you suspect malware, pair them with the steps in my Windows troubleshooting guide and a full system scan.
Command 7: Chain DISM, SFC, and an Auto-Restart in One Shot
The classic Windows repair flow is well known: run DISM to repair the component store, then run SFC to repair system files using that good source, then restart. The annoying part is that you have to babysit it — wait for DISM to finish, run SFC, wait again, then remember to restart.
You can chain all three with semicolons in PowerShell so the next command runs automatically as soon as the previous one finishes:
DISM /Online /Cleanup-Image /RestoreHealth ; SFC /scannow ; shutdown /r /t 30
The ; tells PowerShell “when this command finishes, run the next one.” DISM goes first because it repairs the source files SFC pulls from. SFC then uses that repaired source to fix damaged system files. Once both finish, shutdown /r /t 30 reboots the PC after a 30-second countdown so you can read the scan results before the restart.
Set the /t value to whatever fits your workflow:
/t 0— restart immediately when both scans finish/t 30— 30-second window to glance at the scan output/t 300— five-minute window if you want to read the full SFC report
If you’d rather kick off the chain and walk away, /t 0 is the cleanest option. For a deeper walkthrough on what these commands actually fix, see my guide on fixing the Blue Screen of Death on Windows 10 and 11, which uses the same DISM and SFC flow.
Want a UI Instead of Typing Commands?
If the bloatware-removal command is what you came for and you’d rather not maintain a list of package names by hand, my free open-source app Winhance handles it at scale through a proper interface. You can pick which apps to remove, save the removal scripts so apps stay gone after Windows updates reinstall them, and apply optimizations the same way. The full project (and downloads) lives at winhance.net.
For a broader collection of “every Windows user should know” tools that pair well with these PowerShell commands, my PowerToys guide covers Microsoft’s official utility set — different category, similar spirit.
Frequently Asked Questions
Do I need PowerShell 7 to run these commands?
No. Every command in this guide runs in Windows PowerShell 5.1, which is built into Windows 10 and Windows 11 by default. PowerShell 7 is a newer cross-platform release and worth installing for advanced scripting, but it is not required for any of these commands.
Why does Stop-Process or Remove-AppxPackage say “access denied”?
You’re running PowerShell as a standard user. Both commands need elevated rights. Close the window, right-click the Start button on Windows 11 and pick Terminal (Admin), or right-click Windows PowerShell in the Start menu on Windows 10 and pick Run as administrator.
Can I undo Remove-AppxPackage if I uninstalled the wrong app?
Most built-in apps can be reinstalled from the Microsoft Store. The Microsoft Store itself is the trickiest case — if you removed it, the recovery path is documented in my guide on reinstalling the Microsoft Store on Windows 10 and 11. Always test removal commands on a virtual machine or a non-critical install first.
Does winget upgrade –all update everything on my PC?
It updates every app that has a winget package and an available newer version. Apps you installed by downloading an installer from the vendor’s website are not tracked by winget unless they ship a winget package, so those won’t be updated by this command. For Windows itself, use Windows Update — winget does not handle OS updates.
Is it safe to chain DISM, SFC, and a restart in one command?
Yes. The semicolon chain runs each command sequentially — the next one only starts when the previous one exits cleanly. DISM and SFC are Microsoft’s own repair tools, designed to be run together in this exact order. The auto-restart at the end simply applies any fixes that need a reboot, which is the same step you’d run manually.
