Jim Fitzgerald
asked on
PowerShell Tab Completion for External Commands (MSIEXEC.EXE in particular)
When using PowerShell, either the console or ISE (as a shell - I'm not concerned with scripting for this question), how does one tab complete when using an external command so that .\ is NOT placed in front of your argument.
So my specific example is this: I am a Setup Developer. I use msiexec.exe all the time..
So to test my packages I go to (instead of CMD prompt) PowerShell and type say something like:
(assume testpackage.msi is in my current directory)
PS C:\Packages\TestPackageFol der> msiexec.exe /i test <hit tab complete here and I get>
PS C:\Packages\TestPackageFil der> msiexec.exe /i .\testpackage.msi
Now, msiexec.exe has no idea what .\testpackage.msi means and can't find testpackage.msi - Therefore I have to backspace and delete .\ so that finally I get
PS C:\Packages\TestPackageFil der> msiexec.exe /i testpackage.msi
THAT works.
I get that PowerShell needs an absolute or relative path, but my external commands, especially msiexec.exe which is my bread and butter does not.
I tried & at the beginning of the command like:
PS C:\Packages\TestPackageFil der> & msiexec.exe /i .\testpackage.msi
but that makes no difference - tab complete still appends .\
Going nuts.. Want to learn PowerShell and abandon CMD.exe but as you can imagine, since I run the above command probably 100 times a day I'm losing time and productivity.
Any help is appreciated! Thanks!
So my specific example is this: I am a Setup Developer. I use msiexec.exe all the time..
So to test my packages I go to (instead of CMD prompt) PowerShell and type say something like:
(assume testpackage.msi is in my current directory)
PS C:\Packages\TestPackageFol
PS C:\Packages\TestPackageFil
Now, msiexec.exe has no idea what .\testpackage.msi means and can't find testpackage.msi - Therefore I have to backspace and delete .\ so that finally I get
PS C:\Packages\TestPackageFil
THAT works.
I get that PowerShell needs an absolute or relative path, but my external commands, especially msiexec.exe which is my bread and butter does not.
I tried & at the beginning of the command like:
PS C:\Packages\TestPackageFil
but that makes no difference - tab complete still appends .\
Going nuts.. Want to learn PowerShell and abandon CMD.exe but as you can imagine, since I run the above command probably 100 times a day I'm losing time and productivity.
Any help is appreciated! Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for confirming that this is impossible.
Example
script file name get-user.psm1
function get-user
import-module .\get-user.psm1
Now when you do get-module you will see your module in the PS session
You can then Tab complete get-u >Tab = get-user
Will.