How do you set PowerShell's default directory?

前端 未结 13 1751
生来不讨喜
生来不讨喜 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 02:03

    Using just the command line, if a file exists already it will append to it:

    $(if (-Not (Test-Path ~\Documents\WindowsPowerShell\)){ mkdir ~\Documents\WindowsPowerShell\}) ; echo "Set-Location c:\THELOCATIONYOUWANT" >> ~\Documents\WindowsPowerShell\profile.ps1
    

提交回复
热议问题