How do you set PowerShell's default directory?

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

    Putting Set-Location into your profile will unconditionally change the current working directory, which might have unwanted consequences in regards to the working directory for scripts that you execute via "run with PowerShell".

    An alternative solution is to change the working directory for the .lnk files to PowerShell usually found in %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell. Right click on a link, and change the working directory from %HOMEDRIVE%%HOMEPATH% to the directory you want.

提交回复
热议问题