Loading PowerShell Modules

by Jun 16, 2015

All cmdlets live in modules or snap-ins. To see which modules are currently loaded, use Get-Module.

In PowerShell 3.0 or better, most modules are imported implicitly when you run a cmdlet found in that module. This clever mechanism implements a "load on demand", so in most cases there is no need to load modules manually, nor makes it sense to manually load all modules.

To turn this auto-loading off, use this:

$PSModuleAutoLoadingPreference = 'none'

Note that when you do this, it is now your responsibility to load all required modules.

If you want to load all available modules, use Import-Module.

This would load all available modules on your entire system:

Get-Module -ListAvailable | Import-Module -Verbose

Twitter This Tip! ReTweet this Tip!