Solve IntelliSense hangs in Integrated Scripting Environment

Solve IntelliSense hangs in Integrated Scripting Environment

Q. I am using the PowerShell Integrated Scripting Environment (ISE) however every command I type results in a 30 second delay that Intellisense is stopping. How do I fix this?

A. I recently saw this on a box that an add-in had recently been removed from. Every time I typed at the bottom of the screen it would have a message that Intellisense was stopping but it would hang for about 30 seconds and during this time I could not run PowerShell within the environment. The problem was the cache PowerShell ISE uses to remember all the commands in each module and it will still trying to access modules that were not present and the timeout was caused by trying to find the content. The solution was to remove the cache:

  1. Stop the PowerShell ISE
  2. Navigate to $env:LOCALAPPDATA\Microsoft\Windows\PowerShell\CommandAnalysis, for example C:\Users\john\AppData\Local\Microsoft\Windows\PowerShell\CommandAnalysis
  3. Delete all the files
  4. Restart PowerShell ISE

Note it will take some times to recache the available commands for Intellisense to function but the previous hang should be fixed.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish