Author Posts

February 24, 2017 at 7:18 pm

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

February 24, 2017 at 8:25 pm

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

February 24, 2017 at 11:08 pm

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?

February 28, 2017 at 1:42 am

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.