1.0 KiB

title, createTime, tags
title createTime tags
powershell修改提示中文件路径 2022/05/18 21:18:57
Windows

参考hiding-the-full-file-path-in-a-powershell-command-prompt-in-vscode

  1. test-path $profile (is there a profile set up?)
  2. new-item -path $profile -itemtype file -force (assuming the answer to the above is false)
  3. notepad $profile (opens notepad)
  4. paste in (from the SuperUser answer above)
function prompt {
  $p = Split-Path -leaf -path (Get-Location)
  "$p> "
}
  1. save (you shouldn't have to chose a location, it is already done for you)

    这里其实直接新开一个 powershell 窗口就可以了

  2. reload vscode - you will probably get an error message about running scripts (or just do next step before reload)
  3. Set-ExecutionPolicy RemoteSigned -Scope CurrentUser (at your integrated terminal PS prompt, also from the SuperUser answer)
  4. reload vscode