【问题标题】:Change PowerShell appearance - Command Line on line below directory更改 PowerShell 外观 - 目录下的命令行
【发布时间】: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


【解决方案1】:

您需要修改prompt 函数。

以下内容可以满足您的要求:

function prompt {
    Write-Host "$(Get-Location) > "
    return "$ "
}

只需将其粘贴到现有的 PowerShell 窗口中即可立即启用它。如果您想使其永久化,请将其添加到您的profile.ps1

This link 有关于修改配置文件的信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-17
    • 2021-10-03
    • 2021-09-14
    • 1970-01-01
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    • 2013-07-19
    相关资源
    最近更新 更多