Can powershell auto filled shortcut with tab?

i would like to add some shortcut file in bin file to open it in powershell,but some files’ name is too long
and i want to tab to auto filled it
in powershell only exe file or ps1 file could auto filled with tab
i was wondering if shortcut lnk file could also filled with tab like exe file
and i could add some shortcut to my bin path always start it in powershell


I guess i’m not quite clear on what your end goal is. Powershell provides tab completion. For Example, Get-ChildItem on the path parameter provides tab completion that will tab complete to shortcuts as well. also simply typing .\ in PS and hitting tab will cycle through the options. you can provide more info like `.\folder1\folder2’ and at each level it will by default cycle through options to help you quickly get to a path.

Hopefully this helps some. If you need additional assistance, could you better explain what exactly you want to do or what goal you are attempting to accomplish? Are you trying to write a script to do something or are you wanting a shortcut you can launch very quickly using PS without fumbling through folders?

maybe i am not really think of this ,the file i download in my pc dosen’t have its own bin path ,i just trying to add shortcut to the bin path ,and then i could always open it in powershell without fumbling through path ,for example ,i can add Commonly used exe file to bin path very quickly and i can open it quicker next time
by either using script or using the right click

after adding to the bin path ,i would like them to complete with tab ,so i didn’t need to type the fullname of the file
but powershell seems can’t complete file except exe or ps1 file

Have you considered a custom function that you add to your PS profile that let’s you invoke the shortcuts? You could probably accomplish the autocomplete in said function in a number of ways, such as via a dynamic parameter or even an argument completer (Register-ArgumentCompleter). Lots of online resources on those though that explain it better than I could :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.