DEV Community

Discussion on: Add a Bash-like autocomplete to your PowerShell

brunovieira97 profile image
Bruno Vieira • Edited on


  • PowerShell has a default KeyHandler for MenuComplete, that is Ctrl+Space.
  • PowerShell has the alias start for its Start-Process cmdlet, that allows you to spawn an application process, but the key is that, on Windows, when you call Start-Process for a file, the OS will start the process of the default application for that file type AND pass the file as a parameter for it as well, opening it. So, in practice, it's the exact same as open from MacOS, but you write start, like this:
    PS > start .     // will open the current directory on the default file explorer
    PS > start notepad file.txt     // will start notepad opening file.txt
    PS > start notepad     // will only start notepad
    PS > start file.txt     // will start the process for default app for txt files, and open file.txt on it
Enter fullscreen mode Exit fullscreen mode

You can also call the default app process without using start, for example, doing this:

    PS > explorer .
    PS > notepad file.txt
    PS > file.txt
Enter fullscreen mode Exit fullscreen mode

The only thing you CAN'T do on PowerShell by default is opening a folder without either a command or an explicit call to explorer.exe.