none
PowerShell 6.x - Search for UNC Share RRS feed

  • Question

  • Hi,

    Just installed the latest PowerShell 6.x for the first time.  Each time when I open the command prompt, it takes about two minutes to display the actual prompt for me to enter a command.  In addition, each time I issue a command, Connect-AzAccount for example, it would try to search for modules as shown below:

     

    This takes about a minute or two.  Why is it doing that?

    Thanks

    Thursday, July 11, 2019 9:07 PM

Answers

  • Hi Ultragc88,

    What method you are using to download and install PowerShell V6 ?

    You can please check the GitHub link to download the .msi and install it on your machine. When installing, it would ask for location/path on where you want to install, which can be your local path.

    Additional documentation reference to Install PowerShell core on Windows

    Hope this helps. Please feel free to revert back if you need any additional information. Thanks

    -----------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members. Thank you

    Friday, July 12, 2019 10:33 PM
    Owner

All replies

  • Hi Utlragc88,

    Possible reason seems to be that your PowerShell modules are stored in UNC path and you are trying to load it from UNC which  is leading to the latency. 

    Can you please check this out using the below command 

    PS C:\WINDOWS\system32> $env:PSModulePath -split ';' 

    You can refer to Save-Module cmdlet which saves a module and its dependencies on the local computer but doesn't install the module and see if solves the latency issue you are seeing. 

    Hope the above information helps. Please revert back if you have any further queries. 

    Thursday, July 11, 2019 10:53 PM
    Owner
  • Thanks for the info BharathN.  You are right, I ran the command and its the following

    \\SERVER\users\NAME\My Documents\WindowsPowerShell\Modules
    C:\Program Files\WindowsPowerShell\Modules
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\

    I still have PowerShell 5.1 installed on my machine and I want to keep it that way.  For nor, I have uninstalled PS v6.  Any suggestions if I re-install it again?  I don't remember seeing an options for me to choose the installation and module path.

    Thanks

    Friday, July 12, 2019 5:58 PM
  • Hi Ultragc88,

    What method you are using to download and install PowerShell V6 ?

    You can please check the GitHub link to download the .msi and install it on your machine. When installing, it would ask for location/path on where you want to install, which can be your local path.

    Additional documentation reference to Install PowerShell core on Windows

    Hope this helps. Please feel free to revert back if you need any additional information. Thanks

    -----------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members. Thank you

    Friday, July 12, 2019 10:33 PM
    Owner
  • Thanks.  I will give it another try next week.
    Friday, July 12, 2019 11:34 PM