09 January 2015

About modules in powershell v3

Powershell have two default location in which it search for modules: one for the system and one for the user currently logged on:

  • system: %windir%\System32\WindowsPowerShell\v1.0\Modules
  • user: %UserProfile%\Documents\WindowsPowerShell\Modules
these values are stored in a environment variable $ENV:PSModulePath

Modules from this location will be automatically imported in powershell v3.

Get-Command cmdlet will return commands from imported or modules available in the two paths.

In powershell v3, modules can be imported (or listed) from another computer trough a cimsession or powershell session:

Import-Module -CimSession $session -Name ModuleName

Get-Module -CimSession $session -ListAvailable

No comments:

Post a Comment