When loading a module that is not in $Env:PsModulePath, you have to specify the full path to the .psd1/.psm1, like "ipmo C:\src\MyMod\MyMod.psd1". It is handy to use tab completion to complete various parts of that path.
Unfortunately, the completer for Import-Module's Name parameter interferes with this. When you hit [Tab], it replaces the path you've been building with just the name of a module that it discovered on that path. For instance, typing something like "ipmo C:\src\MyM[Tab]" completes to just "ipmo MyMod", which won't work (or vexingly, if C:\src\MyMod contains an in-development version of your module, but MyMod also exists on $Env:PsModulePath, it will work, but load the other one that you didn't want).
For reference, here is the completer (found in Microsoft.PowerShell.Core.ArgumentCompleters.ps1):
When loading a module that is not in
$Env:PsModulePath
, you have to specify the full path to the .psd1/.psm1, like "ipmo C:\src\MyMod\MyMod.psd1
". It is handy to use tab completion to complete various parts of that path.Unfortunately, the completer for Import-Module's Name parameter interferes with this. When you hit [Tab], it replaces the path you've been building with just the name of a module that it discovered on that path. For instance, typing something like "
ipmo C:\src\MyM[Tab]
" completes to just "ipmo MyMod
", which won't work (or vexingly, ifC:\src\MyMod
contains an in-development version of your module, but MyMod also exists on$Env:PsModulePath
, it will work, but load the other one that you didn't want).For reference, here is the completer (found in Microsoft.PowerShell.Core.ArgumentCompleters.ps1):