1 Reply Latest reply on Apr 25, 2015 3:41 PM by LucD

    PSModulePath missing default folder after PowerCLI 6 installation

    Scissor Virtuoso
    User Moderators

      On a fresh install of Windows 8.1, the '%userprofile%\Documents\WindowsPowerShell\Modules' folder is included in $env:PSModulePath.  After installation of PowerCLI 6.0 I see that folder is no longer included.  This breaks people who have installed modules under their Documents directory.

       

      The problem is linked to Environment variables.  A fresh install of Windows has a SYSTEM PSModulePath variable defined but no USER one.  In this situation PowerShell appears to silently add '%userprofile%\Documents\WindowsPowerShell\Modules' to $env:PSModulePath.

       

      If you create a USER PSModulePath variable then this silent behavior changes.  The PowerCLI 6.0 installer does create a USER PSModulePath variable if one does not already exist.

       

      This behavior is also called out near the bottom of this blog posting:  https://www.sapien.com/blog/2012/05/22/psmodulepath-discrepancies/

       

      I'm not sure what the best way is for the PowerCLI 6 installer to address this.  Perhaps it can be added to the release notes at least.