February 20th, 2013

PowerTip: Turn Off PowerShell Module Autoload

Doctor Scripto
Scripter

Summary: Learn how to turn off Windows PowerShell module auto-loading.

Hey, Scripting Guy! Question I want to disable the Windows PowerShell 3.0 module automatic loading of modules. How do I do this?

Hey, Scripting Guy! Answer Set the value of the $PSModuleAutoloadingPreference automatic variable to none, as shown here.

$PSModuleAutoloadingPreference = “none”

Note   I do not recommend you make this change except in very specific situations and for very specific reasons. The number of Windows PowerShell cmdlets and functions in Windows Server 2012 and Windows 8 would make knowing which module a particular command resided in extremely difficult; with this change in place, you have to specifically load the module prior to using any commands.

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.