.Net, Azure and occasionally gamedev
Just a few nifty shortcuts that not everyone seems to know about the various supported shells in windows and shortcuts to launch them.
By default you have cmd and powershell available in Windows 10. You might launch them by searching in the startmenu or by typing their names into the Run dialog (Win + R) directly.
But did you know there's plenty other (faster) ways to launch them, too?
If you are inside any folder in Windows Explorer you can just shift + right click in any empty area (for this to work you may not have any items selected) and the context menu will then contain an extra entry "Open PowerShell window here":
You now have a powershell session inside the current folder.
Unfortunately this only allows you to launch powershell as it's hardcoded inside the registry..
But wait, there's more!
Did you know that you can just type the name of any executable inside your path into the explorer bar and press enter to run it inside the directory?
The program will just get launched in the specific directory!
Protip: When inside a directory just press "F4" it will auto select the explorer bar with all text so you can just start typing "cmd" + enter without having to use the mouse at all!
In case you want admin rights none of the solutions mentioned above will work, but there's one that does work:
File -> Open Windows PowerShell -> Open Windows PowerShell as administrator
Unfortunately I haven't yet found a quick way to access an admin shell with the keyboard. You could press "Alt, F, S, A" in that order (shortcut for the admin powershell via file menu mentioned above) but at that point are you really faster?
You can seamlessly switch between the various shells by invoking another shell by its name.
Which is why here's a command prompt running powershell running wsl and all of them displaying the time using their native commands:
turtles shells all the way down!
To switch between the different shells just type their names "cmd", "powershell" or "wsl"
If you are inside wsl you will have to type "cmd.exe" and "powershell.exe" for it to work. Alternatively you can just alias them:
alias cmd=cmd.exe alias powershell=powershell.exe alias ps=powershell.exe
I've seen way to many people who still launch cmd/powershell from startmenu and then "dir + cd xyz" their way to the target directory in a painstaking way.
Hopefully this has shown you a few ways to launch shells faster.