Where the PowerShell Modules are stored?

PowerShellMicrosoft TechnologiesSoftware & Coding

PowerShell modules are stored in their module path. Module paths can be retrieved using an environmental variable $env:PSModulePath. To get a better view, we will split the variable path with a semicolon.

$env:PSModulePath -split ';'

C:\Users\Administrator\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules

You can see the 3 paths above. Each path has Modules stored as per their scopes.

  • Documents Path: Modules are stored in this path when you provide the scope – CurrentUser while installing the module.

  • Program files path: Modules are stored in this path when AllUsers Scope is provided.

  • System32 path: It is the default path for the module. Whenever Microsoft updates any PowerShell version or module, it is installed on this location.

raja
Published on 11-Nov-2020 13:07:57
Advertisements