Loading Modules Automatically

by Nov 21, 2013

Beginning with PowerShell 3.0, PowerShell is smart enough to know which cmdlets are exported by which extension module. So you no longer have to know the module name and manually import it (using Import-Module). Instead, auto-completion and IntelliSense will suggest every single command available from every module that is installed in one of the standard module folders. Here's a method to list these standard folders:

The standard folders may vary, and you can add more folders to the environment variable if you want, making modules available stored on USB sticks or external drives. This would add the path of a USB drive to your list, so all modules stored in the folder specified would also be included automatically:

Twitter This Tip! ReTweet this Tip!