How do you set PowerShell's default directory?

前端 未结 13 1747
生来不讨喜
生来不讨喜 2021-01-30 01:37

Is there a way to change PowerShell\'s default location?

How do you set PowerShell\'s default working directory?

13条回答
  •  被撕碎了的回忆
    2021-01-30 01:50

    I had tried the above answers in Windows Server 2016 without success.

    But I found this approach (it should be the same for Windows 10) working for me.

    1. Start a PowerShell session
    2. In the Taskbar, right-click and pin to keep a link there
    3. Again right click the icon in taskbar and then right-click Windows PowerShell and choose Properties
    4. Enter your preferred directory in the Start in: input field and press OK
    5. Start from the taskbar icon

    Done!

    In the same Properties dialog you can also change many other settings like fonts, colors, sizes and on the Shortcut tab there via button Advanced. You can select if that PowerShell session is to be run with administrator privileges.

提交回复
热议问题