How do you set PowerShell's default directory?

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

    This solution sets current working folder to location where script is located. Be sure to place at beginning of your script, or at least before you try to use command relying on location path.

    Set-Location (Split-Path $MyInvocation.MyCommand.Path)
    
    0 讨论(0)
提交回复
热议问题