January 5th, 2015

PowerTip: List Folders Containing PowerShell Modules

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.