Windows Powershell and Visual Studio Running Extremely Slow

Daniel Bulakh 15 Reputation points
2024-04-24T19:29:34.0733333+00:00

Hello,

I work as an IT support engineer for my company and a user reached out to me saying that they have been experiencing issues with their VS code and Powershell commands running very slow. I recreated the same environment on my laptop, and I had the same issues with it being slow.

A test I did was running this command in Powershell as an admin

cd c:\

This took about 11 seconds to complete when in reality it should take no more than a second.

A week ago, this user reports it was running fine and fast with no issue, but seemingly starting on 4/23/2024 it became slow.

Does anyone else have the same issue? Perhaps it's from a recent windows update that is causing it run very slow.

Thanks!

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,621 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,216 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,081 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ari Volcoff 0 Reputation points
    2024-04-25T09:04:11.4833333+00:00

    Make sure to install the powershell 7 from microsoft store and update your visual studio 2022 to the latest version (17.9.6) - then it works correctly

    0 comments No comments

  2. MotoX80 31,656 Reputation points
    2024-04-25T11:35:11.5466667+00:00

    As with any other performance problem, start with Task Manager and Resource Monitor and watch cpu/memory/disk/network statistics.

    For detailed analysis, Process Monitor is a great tool to trace the file/registry/network calls that a program makes. What is Powershell doing during those 11 seconds?

    https://learn.microsoft.com/en-us/sysinternals/downloads/procmon

    If you're running a 3rd party antivirus product, temporarily disable that. They are typically #1 on the suspect list for performance problems.