How do you set PowerShell's default directory?

前端 未结 13 1734
生来不讨喜
生来不讨喜 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:55

    Type this in PowerShell:

    New-Item -path $profile -type file –force
    

    It creates a .ps1 file in the PowerShell folder. Open it, and edit it as:

    Set-location C:\files
    

    Done

    Refer to this link. It works fine.

    Change PowerShell Start Directory

提交回复
热议问题