module location

This topic contains 3 replies, has 2 voices, and was last updated by  Rob Simmers 1 year, 4 months ago.

  • Author
  • #65229


    Hi Powershell Guru,

    I put my team module inside of 'C:\windows\system32\WindowsPowershell\v1.0\modules' directory. I heard that this directory is regard as 'holy site' for modules from Microsoft, not for 3rd party modules. The reason I put it there it is because I can remote to different server and use my team module from the remote server as long it is under the 'holy site'. If I put my modules elsewhere, I can't access them through remote server.

    I like to weight in the pros and cons to put 3rd party modules inside of the 'holy site'. Also, I would like to know another way to access my team module at remote server.


  • #65235

    Rob Simmers

    There are multiple places that you can place a Module that Powershell will search by default. Below, you can see using $env:PSModulePath what the standard module paths are (outside of the first, which is obviously a dynamic user path):

    PS C:\Users\Rob> $env:PSModulePath -split ";"
    C:\Program Files\WindowsPowerShell\Modules

    You could place the module in C:\Program Files\WindowsPowerShell\Modules or you can also specify a full path to the module as well:

    Import-Module -FullyQualifiedName C:\AdminTools\Powershell\Modules\MyModule
    • #65251


      Thanks for posting, Rob.

      I wonder if I just leave my team module inside of C:\windows\system32\WindowsPowershell\v1.0\modules, will it do any harm?

  • #65341

    Rob Simmers

    I've put modules there in the past with no issues. Microsoft does place their modules there, but I've seen vendors\3rd party modules placed there as well.

You must be logged in to reply to this topic.