I've been having issues with PowerShell on my Windows Terminal. Whenever I boot up my PC, it takes around 10-15 seconds to become responsive, and then my whole screen goes black for about half a minute before everything starts working. I really don't think this is a problem related to my PC's specifications since it has been running fine until recently. This lagging issue just started two days ago. Any advice on how to fix it would be greatly appreciated!
5 Answers
Have you checked what’s in your PowerShell profile? Avoid loading too many modules at startup—only include the ones you use most. Additionally, a strict execution policy could slow things down if PowerShell has to check certificates for signed modules. Network issues can also cause delays while it tries to verify these certificates. It's worth taking a look!
I experienced something like this on an older laptop. It was actually Windows Defender causing issues—it was using a ton of CPU and making everything slow. Once I disabled real-time protection for Defender, everything ran smoothly again. Just a thought, but if nothing else is causing it, maybe something like that could be worth checking, though I understand you think it might not be the issue.
I'm not sure if Defender is the cause, as this issue seems isolated to the terminal app. Thanks for sharing your experience!
It sounds like others might be facing similar lags. If you're not finding a solution soon, you might want to narrow it down. Use logs or process explorer to see what's causing the delay. It could help identify if it's a specific app or process.
I had a similar issue at work where PowerShell would lag for several minutes when opening. It turned out my modules folder had about 10GB of unnecessary modules to load at startup, specifically due to multiple versions of AWS PowerShell modules piling up over time. I cleaned it up by keeping only the latest versions, which fixed the performance. If you have a lot of modules, check what’s loading on startup—it could be the culprit!
Exactly! I have a small modules folder, only about 2.5MB, yet I still face this issue. Thanks for sharing your experience, though!
If cmd and PowerShell work fine in VS Code, the problem might be specific to the Windows Terminal. It’s possible you have a proxy or some settings that are causing those lags. Consider setting these environment variables:
- POWERSHELL_CLI_TELEMETRY_OPTOUT = "1"
- POWERSHELL_UPDATECHECK = "Off"
Setting these could help reduce startup delays.
But why is this only a problem with the terminal and not with Command Prompt? They seem to run fine administratively. I also checked the execution policies, and everything seems correct.