$PSModuleAutoLoadingPreference and You

This is a very simple onelner.  The problem statement is a more complicated.

PSH 3 and 4 treat PSModules in a very funny way.  These versions have a default module path, and will return any cmdlet that happens to be in any module that happens to be in any directory in the default module path, no matter if you’ve Imported the Module or not.  While this is handy, it can cause a distracting Write-Progress-like banner when the script searches for something obscure.

Here’s how you stop it:

$PSModuleAutoLoadingPreference = ‘none’
Comments (0)

Skip to main content