0

Every time I open a Windows powerShell I need to cd to a particular folder.

Is there a way to configure it in the powerShell parameters (I am thinking of the parameters Json for instance)?

I have found that set-location can be usefull. I tryed "Set-Location": "c:/", in the parameters json but it seems not to work.

Any ideas?

update after thom schumacher's comment: I think I have already a profil and I am interested in the first one : (a part of my parameteres json)

 "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        },
        "list":
        [
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory":"//wsl$/Ubuntu-20.04/home/vmelin",
                "colorScheme": "Solarized Dark",
                "fontFace": "Cascadia Code PL"
            },
...

adding "Set-Location": "/home/aalidra" in this profil didn't make it.

Thx

1 Answer 1

1

Look at this article about Powershell Profiles.. if you add a profile then you can add the CD that you want: PowerShell Profiles

Sign up to request clarification or add additional context in comments.

2 Comments

This is the best way to do this. One could also modify the shortcut so that the 'start in' is set to the folder in question.
Thx Thom for your answer. I have updated my question accorfing to your suggestion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.