PowerShell缩短路径

PowerShell 缩短提示符路径

缩短显示路径 临时

Function Prompt { "$( ( get-item $pwd ).Name )>" }

全局

文件位置,如果该文件不存在,手动建立一个。
%UserProfile%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 加入

  function prompt {
    $p = Split-Path -leaf -path (Get-Location)
    "$p> "
  }

注意:较新的版本位置为
%UserProfile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
posted @ 2020-08-29 17:33  指左转右  阅读(807)  评论(0编辑  收藏  举报