Powershell module is slowing down my computer.

Welcome Forums General PowerShell Q&A Powershell module is slowing down my computer.

Viewing 1 reply thread
  • Author
    Posts
    • #251624
      Participant
      Topics: 27
      Replies: 28
      Points: 250
      Rank: Participant

      Hi Everyone,

      Based on my understanding:
      PowerShell uses $Env:PSModulePath to indicate where it should look for modules to execute commands.
      It does lookups on every folder in the list whenever trying to autocomplete a command with the Tab key on the command line.

      Findings:
      By default one of the paths in this variable is “~\My Documents\WindowsPowerShell\Modules”. This normally would be okay,
      however on our domain, this directory is mounted on a file share.

      The issue is that with it doing lookups in the network drive all the time it makes using PowerShell a lot less responsive, with delays of 200ms to 2000ms+ per attempted to autocomplete (which adds up over time).

      Interestingly this path doesn’t appear in my local system environment variables page either like the  two lines below only:

      Questions:

      1. Is it possible that there is some form of Group Policy which is influencing this?
      2. The latency on the Network drive causes problems with general computer responsiveness in a number of use-cases, So how can I fix this performance slowdown issue?

      Note:

      • This topic was modified 3 months, 2 weeks ago by IT Engineer.
      • This topic was modified 3 months, 2 weeks ago by kvprasoon.
      • This topic was modified 3 months, 2 weeks ago by kvprasoon.
      • This topic was modified 3 months, 2 weeks ago by kvprasoon.
    • #252383
      Senior Moderator
      Topics: 9
      Replies: 1422
      Points: 5,290
      Helping Hand
      Rank: Community MVP

      Yeah, looks like that path is causing the slowness. Are you using any profile script ?

      Check the $Profile script is being used and if it has any code to add that location in module path.

Viewing 1 reply thread
  • The topic ‘Powershell module is slowing down my computer.’ is closed to new replies.