module location

Welcome Forums General PowerShell Q&A module location

This topic contains 3 replies, has 2 voices, and was last updated by

 
Participant
1 year, 12 months ago.

  • Author
    Posts
  • #65229

    Participant
    Points: 0
    Rank: Member

    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.

    thanks
    vsnake

  • #65235

    Participant
    Points: 527
    Helping Hand
    Rank: Major Contributor

    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:\Users\Rob\Documents\WindowsPowerShell\Modules
    C:\Program Files\WindowsPowerShell\Modules
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\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

      Participant
      Points: 0
      Rank: Member

      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

    Participant
    Points: 527
    Helping Hand
    Rank: Major Contributor

    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.

The topic ‘module location’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort