How do we open PowerShell from the current directory?

The scenario is a shortcut to PowerShell from that directory. Now I’m wondering how to get it to default to that directory when it opens, rather than the directory where it resides. Any ideas or tech tips?

Windows 10, btw.

If this is just a regular instance of PowerShell, you can just open the file explorer to that directory, then choose File -> Open Windows PowerShell (this is standard now in Windows 10 I believe).

image

If this shortcut is special in some way (i.e., runs a script, etc.) you can right-click on the shortcut and fill in the “Start in” field with whatever path you want:

2 Likes

I’ve had W10 since February and still didn’t know that. So obvious it’s almost embarrassing. Got the shortcut to work from that directory, too. Again, totally painless. Thanks a tonne, @el_cocodrilo!

3 Likes

You might also want to give Windows Terminal a shot too. It’s free (and open-source), and it’s also very good. Offers tabbed terminals for PowerShell, Command Prompt, and WSL. It’s here: https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701

It has other features that are helpful, such as being able to right-click on a folder and opening up a PowerShell to that directory:
image

2 Likes

@selectall, I recently set up Windows Terminal for myself and I wish I’d done it sooner. I love how customizable it is, and I love having all my shells in one place. Right now, these are what I have set up for tabs:
image

It takes a bit of work to customize every aspect of it and I haven’t had the time yet, but even just getting it set up like this has been well worth it for me. I imagine the default settings would be enough for most Windows users.

EDIT: For what it’s worth, you can also customize the starting directory for each of your tabs from the Windows Terminal settings.json file.

3 Likes

Am I supposed to uninstall PowerShell, cause that is all I’m getting when I launch Windows Terminal. Go ahead, dumb it down for this old codger.Wha

You don’t need to uninstall anything. I see that text banner for trying the new PowerShell too, but you don’t have to do anything about that.
The + at the top lets you add more tabs, but you can also click the caron (the downward arrow looking character next to the +) to see what other options are available by default. You can also customize it, like @el_cocodrilo mentioned.

3 Likes

B____y H__l if that wasn’t right up there with, easy. You guys are shaming me. But, it’s alright because there are a lot of people who would not shame themselves by asking these questions. I’m awed at the level of understanding being demonstrated. Let’s keep that up!

3 Likes