Windows Powershell个性化设置(Windows PowerShell personalization)

1. 设置Powershell prompt只显示当前目录;

2. 设置Powershell title为当前路径;

这个文件的路径为:echo $profile

# file location:echo $profilefunction prompt {
  $p = Split-Path -leaf -path (Get-Location)
  "PS $p> "
  
  $host.UI.RawUI.WindowTitle = (Get-Location)
}

function which($c) {
  Get-Command $c | fl
}
————————

1. Set PowerShell prompt to display only the current directory;

2. Set PowerShell title as the current path;

The path of this file is echo $profile

# file location:echo $profilefunction prompt {
  $p = Split-Path -leaf -path (Get-Location)
  "PS $p> "
  
  $host.UI.RawUI.WindowTitle = (Get-Location)
}

function which($c) {
  Get-Command $c | fl
}