sodcalculator

10 Tech How-To

Fix PowerShell High CPU Usage on Windows

Guide 10-31087 · Updated · Step by step

PowerShell sometimes spikes to 100% CPU on Windows, making your PC sluggish or fans spin up for no clear reason. This guide walks you through the most common causes and fixes, from restarting the service to clearing a corrupted profile, so you can get your system back to normal.

What You’ll Need

  • Administrator access (for some steps)
  • A few minutes of patience

Step-by-Step

  1. Identify which PowerShell process is using CPU. Open Task Manager (Ctrl+Shift+Esc), go to the Processes tab, and sort by CPU. Look for “Windows PowerShell” or “PowerShell”. Note the exact name (e.g., powershell.exe, pwsh.exe) and whether it’s running as a script or a console window. This helps narrow down the cause.
  2. Restart the PowerShell process. If it’s a single instance, right-click it in Task Manager and select “End task.” If it’s a service (like “Windows Remote Management”), you may need to restart the service instead. For a quick fix, open a new PowerShell window as administrator and run Stop-Process -Name powershell -Force (or pwsh for PowerShell Core). This is a temporary fix but often clears a stuck script.
  3. Check for stuck background jobs. In an elevated PowerShell, run Get-Job. If you see any jobs with a status of “Running” but they never complete, remove them with Remove-Job -Id -Force. Stuck jobs can spin endlessly, eating CPU.
  4. Disable PowerShell startup entries. Press Win+R, type shell:startup, and press Enter. Look for any .ps1 or .bat files that launch PowerShell. If you find one, temporarily move it to your Desktop (or delete it) and restart. A misbehaving startup script is a frequent cause of high CPU on boot.
  5. Clear the PowerShell profile. A corrupted or heavy profile can cause high CPU. Open PowerShell and run Test-Path $PROFILE. If it returns True, rename the profile file: Rename-Item $PROFILE $PROFILE.bak. Restart PowerShell and see if CPU usage drops. If it does, your profile was the culprit. You can then restore it and edit out the problematic lines.
  6. Scan for malware. Some malware disguises itself as PowerShell processes. Run a full Windows Defender scan (or your preferred antivirus). Also check for suspicious scheduled tasks: open Task Scheduler (taskschd.msc), look for tasks that run powershell.exe with unusual arguments, and disable any you don’t recognize.
  7. Update PowerShell and Windows. Open Windows Update and install all pending updates. For PowerShell, run winget upgrade Microsoft.PowerShell (if you have PowerShell Core) or just update Windows, which includes Windows PowerShell 5.1. Bugs that cause CPU spikes are often fixed in updates.
  8. Repair .NET Framework. PowerShell depends on .NET. If .NET is corrupted, PowerShell may misbehave. Download and run the .NET Framework Repair Tool from Microsoft’s official site, then restart.
  9. Check for conflicting third-party software. Antivirus, backup tools, or system utilities sometimes interfere with PowerShell. Temporarily disable any such software (especially real-time protection) and see if CPU usage drops. If it does, add PowerShell to the software’s exclusion list.
  10. Reset Windows PowerShell (as last resort). If nothing else works, you can reset PowerShell to its default state. Open an elevated PowerShell and run Get-ChildItem $env:APPDATA\Microsoft\Windows\PowerShell and rename the “PSReadLine” folder if it exists. Then restart. This clears custom PSReadLine settings that occasionally cause high CPU.

Common Mistakes

  • Killing the wrong process. Make sure you’re ending the PowerShell process that’s actually using CPU, not the one that’s just open. Check the CPU column in Task Manager.
  • Deleting the profile without backup. If you delete $PROFILE without renaming, you lose all your custom functions and aliases. Always rename first.
  • Disabling Windows services blindly. Disabling “Windows Remote Management” or “PowerShell” services can break other features like WinRM. Only disable if you’re sure it’s the cause.
  • Ignoring scheduled tasks. A scheduled task that runs every minute can cause constant CPU usage. Check Task Scheduler thoroughly.

Tips

  • Use Process Explorer. For deeper analysis, download Process Explorer from Microsoft Sysinternals. It shows which script or command is causing the CPU load inside PowerShell.
  • Monitor with Performance Monitor. Run perfmon and add counters for “PowerShell” to see CPU usage over time. This helps identify patterns (e.g., spikes every hour).
  • Keep PowerShell updated. Regularly update Windows and PowerShell to get performance fixes.
  • Use Get-Process to check. In an elevated PowerShell, run Get-Process powershell | Select-Object CPU, Id, StartTime to see which process has been running longest.

Troubleshooting

If the steps above don’t resolve the issue, try these additional checks:

  • Check Event Viewer. Open Event Viewer (eventvwr.msc), go to Windows Logs > Application, and look for errors related to PowerShell or .NET. These may give clues.
  • Run System File Checker. Open Command Prompt as administrator and run sfc /scannow. This repairs corrupted system files that could affect PowerShell.
  • Perform a clean boot. Disable all non-Microsoft services and startup items via msconfig, then restart. If PowerShell is fine, re-enable services one by one to find the culprit.
  • Create a new user profile. Sometimes the issue is tied to your user account. Create a new local user and test PowerShell there. If it works, migrate your files.
  • Reinstall PowerShell Core. If you’re using PowerShell 7+, uninstall it and reinstall from the Microsoft Store or GitHub. This often fixes corrupted installations.

Frequently Asked Questions

Why does PowerShell use high CPU even when idle?

This usually indicates a background script or scheduled task is running. Check Task Scheduler and your PowerShell profile for any loops or long-running commands.

Can I disable PowerShell to stop the CPU usage?

No, PowerShell is a core Windows component. Instead, find what’s causing the usage and fix that. Disabling it would break many system functions.

Is high CPU usage from PowerShell a sign of a virus?

It can be. Malware often uses PowerShell to execute scripts. Run a full antivirus scan and check for suspicious scheduled tasks.

Does PowerShell Core (pwsh) have the same CPU issues as Windows PowerShell?

Both can have issues, but they are separate programs. If one misbehaves, the other may be fine. Update both to the latest versions.

How do I know which script is causing the high CPU?

Use Process Explorer and look at the process’s command line. You can also enable PowerShell Script Block Logging in Group Policy to see which scripts are executed.

Will resetting Windows fix the problem?

As a last resort, yes. But try all other steps first, as resetting is time-consuming and may remove your apps.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →