【发布时间】:2014-10-22 11:24:37
【问题描述】:
我想知道是否可以更改 PowerShell 的外观,因此您可以在目录行下方添加命令行:
C:\your\directory\path\will\go\here >
$ now-a-super-long-command-can-be-entered-here
【问题讨论】:
标签: windows powershell command-line appearance
我想知道是否可以更改 PowerShell 的外观,因此您可以在目录行下方添加命令行:
C:\your\directory\path\will\go\here >
$ now-a-super-long-command-can-be-entered-here
【问题讨论】:
标签: windows powershell command-line appearance
您需要修改prompt 函数。
以下内容可以满足您的要求:
function prompt {
Write-Host "$(Get-Location) > "
return "$ "
}
只需将其粘贴到现有的 PowerShell 窗口中即可立即启用它。如果您想使其永久化,请将其添加到您的profile.ps1。
This link 有关于修改配置文件的信息。
【讨论】: