PowerTip: List Folders Containing PowerShell Modules

Doctor Scripto

Summary: Learn how to list all folders that contain Windows PowerShell modules.

Hey, Scripting Guy! Question How can I see a list of all folders that contain Windows PowerShell modules?

Hey, Scripting Guy! Answer Use the PSModulePath environmental variable, and split it to form paths to the modules. Then use the 
           Get-ChildItem cmdlet (dir is an alias) and specify only directories while using a wildcard character for a filter.
           Here is an example:

Dir ($env:PSModulePath -split ";") -Filter * -directory

0 comments

Discussion is closed.

Feedback usabilla icon